A comment in PHP code is a line that is not executed as part of the program. Its only purpose is to be read by someone who is looking at the code.
Comments can be used to:
PHP supports two ways to write single-line comments: // and #.
<?php // This is a single-line commentThis is also a single-line comment
echo "Comments are invisible!"; ?>
To comment out multiple lines at once, start the comment with /* and end it with */.
Everything between those markers will be completely ignored by the PHP engine, making it perfect for long explanations or temporarily disabling large blocks of code.
/* This is a multi-line comment block that spans over multiple lines */