Comment code is important part of any kind of programming language.
PHP code comments are the same as HTML code comments.
Comment code is only visible at the part of programming side while run the program the comment code invisible at output side.
While complex programming we have more code at programmer side and many programmer can work on one project so we need to define the code logic with header comment code so other programmer can easily understood the code.
There are two way we can comment code in PHP.
- Single Line Comments
- Multi Lines Comments
Single Line Comments in PHP
In single line comments we can comment only single line using the comment expression “//” and “#”.
Here, Example of single line comments:
// First comment code line
// Second comment code line
# Third line comment
Multi Lines Comments in PHP
Here is the example of Multi lines comment code in PHP.
/* All code are commented with multilines comments
First comment code line
Second comment code line */