PHP Comments

This PHP Comment tutorial will help you learn how to create comments in PHP.

 

What are PHP Comments?

PHP Comments are an important part of code used to describe any line of code to let another developer easily understand the code. Single line and multi-line comments are supported by PHP. However, the comments can be read only by someone looking at the code. 

 

What are the uses of PHP Comments?

You can use PHP Comments for:

  • Enabling other developers to understand your code.
  • To remind yourself of why code does what it is supposed to do.

 

Commenting Syntax:

<?php
// This is a single-line comment

# This is also a single-line comment

/*
This is a multiple-lines comment 
This is a multiple-lines comment 
This is a multiple-lines comment 
*/
?>