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.
- Single Line Comment
- Multiple Comment
- Single Line Comment: We can comment single line by // slash.
// Hello We are learning PHP Comments
echo "Single Line comment by double-slash";
Single Line comment by double-slash
Multi Line Comment: We can comment multiple lines by /*….*/ symbol.
/* Hello We are learning PHP Comments.
You are good developer of PHP */
echo "Example of Multi Line comments.";
Example of Multi Line comments.by