PHP Comments

As a programmer, it is good practice to write a well-documented code that can be read months later by you or any other developer. It simply makes a developer's life easier who wants to make some changes or a few updates on your code.

PHP ignores the commented text during the execution of the script. PHP follows C++ style commenting. You can use the double forward slash to comment a single line. You can also write multiline comments using the /* */ combination that expands over several lines and write a heading or lengthy.

			

<?php
// We are writing a comment 
# We are again writing a comment in the second way
?>

				

The /* */ code combination is used to write comments that extend over several lines. Helpful is writing a lengthly explanation.

			

<?php
/* 
This is
multiline 
comments
*/
?>