PHP Comments

PHP Comments can be used to hide portion of code line and code description in php programming code. PHP Comments line code can not be executed. Programmer can use PHP Comments to describe code details. PHP Comments can be denoted by // or # for single line and /* */ for multiple line.

PHP Comments Syntax:

// (C++ style single line comment)
OR
# (Unix Shell style single line comment)
OR
/*  */ (multiple line comment)


PHP Example :
<?php

      // php comments for single line
      # Also php comments for single line

      /*
       php comments for multiple line.
       learn php comments tutorials.
       Have Great Day Forever!
     */

    //$i=100;

    echo "Learning PHP Comments Topic.";

?>

Output:
Learning PHP Comments Topic.

Developers can use comments in coding for below purpose.

  1.  Others programmer can understand your code.
  2. You can remind your project work after long times.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

25214