Comments are Non executable portion of code that is not executed as a part of the program. Comments in PHP help developers understand the code, provide context, and make the code more maintainable. 

There are two types of comments in PHP:

  1. Single-line Comments.
  2. Multi-line Comments.

1.  Single-line Comments:

Single-line comments start with ( // Everything come here ) and is not executed.

<?php
// single-line comment
echo "Hello, World!";
?>

2. Multi-line Comments:

Multi-line comments start with /* and end with */. Everything between  will not be executed.

<?php
/*
 multi-line comment
*/
echo "Hello, World!";
?>

Comments are useful for:

  • Documentation - for proper documentations.
  • Debugging - Used for Debugging Purpose.

PHP Comments do not affect the execution of the PHP code and comment section ignored by the PHP interpreter. 

It is good practice to include comments in your code to make  more understandable and maintainable.