PHP Comments
The PHP comment syntax always begins with a special character sequence and all text that appears between the start of the comment and the end will be ignored.

- PHP comments can be used to describe any line of code so that other developers can understand the code easily. It can also be used to hide any code.
- PHP supports a single line and multi-line comments. These comments are similar to C/C++ and Perl style (Unix shell-style) comments.
PHP Single Line Comments
The single-line comment tells the interpreter to ignore everything that occurs on that line to the right of the comment. To do a single line comment type "//" or "#" and all text to the right will be ignored by the PHP interpreter.
There are two ways to use single-line comments in PHP.
// (C++ style single line comment)
# (Unix Shell-style single line comment)
Example 1:
<?php
// this is Php and C++ style single line comment
echo "Welcome to PHP single line comments Example";
?>
Output : Welcome to PHP single line comments Example
PHP Multi-Line Comments
In PHP, we can comments on multiple lines also. To do so, we need to enclose all lines within /* */. Let's see a simple example of a PHP multiple line comment.
Example 2:
<?php
/*
Anything placed
within comment
will not be displayed
on the browser;
*/
echo "Welcome to PHP multi line comment Example";
?>
Output : Welcome to PHP multi line comment
