Comments are those line which are not executed by the compiler. Comments in PHP are similar to comment in C or C++ or JAVA. Comments are the best way to explain the logic of an application. PHP supports both single line a multiple line comments. Let use see how we can add them.
Single Line Comments
There are 2 ways of writing single line comments in PHP. One is the classy old way of using double backslash (\\) and the other one is using the hash (#) symbol. Here’s the example
<?php
echo "Comment Test!"; // Lets test the commenting feature
echo "The other way"; # echo "nothing";
// echo "Does this line print?";
# echo "You can sever see this";
?>

That’s out output. I hope you got the meaning of comments
Multiple Line Comments
When single lines are not sufficient enough to accommodate you comments and you need to put a # symbol on each line, then multi line comments come to your rescue. Using multi line comments is as simple as single line comments. Just start a multi line comment with /* (front slash followed by an asterisk) and stuff everything and then close it with */ (asterisk followed by a front slash).
The example is pretty self explanatory, so lets hit with an example and see how it works
<?php
/* this is a multiline comment
You can use as many lines you want
Just make sure you close it properly */
echo "a multi line comment";
?>
As expected, you get the following output for the above code

So I think that was all about using comments in PHP.
Related posts:
- PHP Syntax, Variables, Echo Statement – Learn PHP in 7 Days – Day #1
- Using Operators in PHP – Learn PHP in 7 Days – Day #2
- Learn PHP in 7 Days
- How to display Posts with most Comments
- MS DOS Tutorials – How to Create, Delete, Change, Rename Directory and Files

[...] #2 – Using Operators in PHP Day #3 – Using Comments in PHP Day #4 – Using Conditional Statements in PHP Day #5 – Using Loops in PHP Day #6 [...]