Comments In PHP

Comments in php code are lines that are not read or executed as part of the program. Its purpose is to indicate some guiding text to  the person editing the code.

Comments are useful for:

  • To let others understand what you are doing, comments help other programmers understand what you were doing in each step.
  • To remind yourself, what you were working on. Most programmers have experienced coming back to their own work a year or two later and have to re-figure the working of their program.

PHP suppports three ways of adding comment/s.

Single Line Comment

// THIS LINE IS COMMENTED

OR

# THIS LINE IS COMMMENTED

 

Multi-line Comment

/*
THIS IS A

MULTI LINE COMMENT

EXAMPLE

*/

 

PHP Case Sensitivity

In PHP, All user defined functions, Classes and keywords are not Case Sensitive.

example:

<?php
ECHO "EXAMPLE";

echo "EXAMPLE";

?>

Both statements will execute.

Facebooktwittergoogle_pluspinterestlinkedinmail