1/23/24, 11:38 PM PHP Multiline Comments
Tutorials Exercises Services Sign Up Log in
HTML
CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C
PHP Multiline Comments
❮ Previous Next ❯
Multi-line Comments
Multi-line comments start with /* and end with */ .
Any text between /* and */ will be ignored.
The following example uses a multi-line comment as an explanation:
Example Get your own PHP Server
Multi-line comment as an explanation:
/*
The next statement will
print a welcome message
*/
echo "Welcome Home!";
Try it Yourself »
https://www.w3schools.com/php/php_comments_multiline.asp 1/6
1/23/24, 11:38 PM PHP Multiline Comments
Multi-line
Tutorials Comments
Exercises to Ignore
Services Code Sign Up Log in
HTML
We canCSS JAVASCRIPT
use multi-line SQLto prevent
comments PYTHONblocksJAVA
of code PHP HOWexecuted:
from being TO W3.CSS C
Example
Multi-line comment to ignore code:
/*
echo "Welcome to my home!";
echo "Mi casa su casa!";
*/
echo "Hello!";
Try it Yourself »
Comments in the Middle of the Code
The multi-line comment syntax can also be used to prevent execution of parts inside a
code-line:
Example
The + 15 part will be ignored in the calculation:
$x = 5 /* + 15 */ + 5;
echo $x;
Try it Yourself »
❮ Previous Log in to track progress Next ❯
https://www.w3schools.com/php/php_comments_multiline.asp 2/6
1/23/24, 11:38 PM PHP Multiline Comments
Tutorials Exercises Services Sign Up Log in
ADVERTISEMENT
HTML
CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C
TAB -
Good IP
proxy
Server
Top quality
residential proxies
+ unlimited
connections +
24/7 customer
support
TABproxy
Open
https://www.w3schools.com/php/php_comments_multiline.asp 3/6
1/23/24, 11:38 PM PHP Multiline Comments
Tutorials Exercises Services Sign Up Log in
HTML
CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C
COLOR PICKER
ADVERTISEMENT
ADVERTISEMENT
https://www.w3schools.com/php/php_comments_multiline.asp 4/6
1/23/24, 11:38 PM PHP Multiline Comments
Tutorials Exercises Services Sign Up Log in
HTML
CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C
SPACES UPGRADE AD-FREE
NEWSLETTER GET CERTIFIED REPORT ERROR
Top Tutorials Top References
HTML Tutorial HTML Reference
CSS Tutorial CSS Reference
JavaScript Tutorial JavaScript Reference
How To Tutorial SQL Reference
SQL Tutorial Python Reference
Python Tutorial W3.CSS Reference
W3.CSS Tutorial Bootstrap Reference
Bootstrap Tutorial PHP Reference
PHP Tutorial HTML Colors
Java Tutorial Java Reference
C++ Tutorial Angular Reference
jQuery Tutorial jQuery Reference
Top Examples Get Certified
HTML Examples HTML Certificate
CSS Examples CSS Certificate
JavaScript Examples JavaScript Certificate
How To Examples Front End Certificate
SQL Examples SQL Certificate
Python Examples Python Certificate
W3.CSS Examples PHP Certificate
Bootstrap Examples jQuery Certificate
PHP Examples Java Certificate
https://www.w3schools.com/php/php_comments_multiline.asp 5/6
1/23/24, 11:38 PM PHP Multiline Comments
Java Examples C++ Certificate
XML Examples
Tutorials Exercises
jQuery Examples
Services C# Certificate
XML Certificate
Sign Up Log in
HTML
CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C
FORUM ABOUT
W3Schools is optimized for learning and training. Examples might be simplified to
improve reading and learning.
Tutorials, references, and examples are constantly reviewed to avoid errors, but we
cannot warrant full correctness
of all content. While using W3Schools, you agree to have read and accepted our terms of
use, cookie and privacy policy.
Copyright 1999-2024 by Refsnes Data. All Rights Reserved. W3Schools is Powered by
W3.CSS.
https://www.w3schools.com/php/php_comments_multiline.asp 6/6