Use of comments in PHP

In the PHP Language, you can place comments in your program that are not executed. Its only purpose is to be read by someone who is looking at the code.

OR

Comments are non-executable code used to provide documentation to programmer.

Comments are two type.

Single Line Comment is used to  comment out just Single Line in the Code. It is used to provide One line description

To know more

  • Single Line Comment Can be Placed Anywhere.

  • Single Line Comment Starts with ‘//’

  • Any Symbols written after ‘//’ are ignored by execution. 

  • Comment cannot hide statements written before ‘//’ and On the Successive new line.

Example :

<html>
<body>
<?php
	echo “Jawab Adda”; //This is a single-line comment
?>
</body>
</html>

Multiple line comments in PHP Language.

To know more

  • Multi line comment can be placed anywhere.

  • Multi line comment starts with /*  and  comment ends with */.

  • Any symbols written between '/*'  and '*/' are ignored by Compiler.

  • It can be split over multiple lines.

Example :

<html>
<body>
<?php
/*
This is a multiple-lines comment block
It can be split over multiple lines
*/
	echo “Jawab Adda”;?>
</body>
</html>