PHP Comment

PHP commentis a line of code that is not executed. It is often used by developer to understand the code. PHP support single and multiple comments. In other language like C, C++ and Unix comments, syntax is same in PHP.

  1. Single Line Comment
  2. Multiple Comment
  • Single Line Comment: We can comment single line by // slash.
Example
<?php
// Hello We are learning PHP Comments
echo "Single Line comment by double-slash";
?>
Output Single Line comment by double-slash Multi Line Comment: We can comment multiple lines by /*….*/ symbol. Example
<?php
/* Hello We are learning PHP Comments.
   You are good developer of PHP */
echo "Example of Multi Line comments.";
?>
Output Example of Multi Line comments.



ADVERTISEMENT
ADVERTISEMENT