PHP Comment

tutorial and example
tutorial and example

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.

  1. Single Line Comment
  2. Multiple Comment
  • Single Line Comment: We can comment single line by // slash.

Example

Output

Single Line comment by double-slash

Multi Line Comment: We can comment multiple lines by /*….*/ symbol.

Example

Output

Example of Multi Line comments.