How to write comments in PHP?
Here the Syntax “// text” and “/* text */” are used.
Comments are written within the block of PHP code to explain the functionality of the code.
Comments help to understand what you were trying to do with the PHP code for the user.
Comments will not be displayed in the output.
This is Single Line Comments
PHP single line comment begins with //.
<?php echo "Hello World!"; // Output "Hello World!" ?>
This is Multi-line Comments
PHP multi-line line comment begins with /*, and ends with */.
<?php /* The following line of code will output the "Hello World!" message */ echo "Hello World!"; ?>