php es text / code lines dks use it to comment, it is not displayed to the user in the web page, the web developer gives the comment for themselves in the source code, in this the description of the code (Explanations) can be given which read the source code. This helps in understanding and therefore developers use the comment.
Symbol of double forward slash (//) is applied next to the text / code lines to be commented in php or use the # symbol.
Syntax
1 // - - - -
2 # - - - -
Example 1
<?php // single line comment example # single line comment example echo " single line comment example "; ?> |
Output
single line comment example |
Symbol of asterisk (*) and forward slash (/) is placed at the end of forward slash (/) and asterisk (*) and text / code lines to comment two or more text / code lines in php.
Syntax
1 /* …..*/
Example 2
<?php /* PHP multiple line comment example PHP multiple line comment example ; */ echo " PHP multiple line comment example "; ?> |
Output
PHP multiple line comment example |