PHP Comments

Description

In programming a comment is the description for our code.

Syntax

There are three ways to create comments in PHP:

  • //
  • /* */, and
  • #.

Note

// and # mean "Ignore the rest of this line,"


     <?php/* ww w.  jav  a2  s. com*/
             print "This is printed\n";
             // print "This is not printed\n";
             # print "This is not printed\n";
             print "This is printed\n";
      ?>
      

The code above generates the following result.

/* means "Ignore everything until you see */."


     <?php/*ww w . j av  a 2  s .  c o  m*/
             print "This is printed\n";
             /* print "This is not printed\n";
             print "This is not printed\n"; */
      ?>

The code above generates the following result.





















Home »
  PHP Tutorial »
    Language Basic »




PHP Introduction
PHP Operators
PHP Statements
Variable
PHP Function Create
Exception
PHP Class Definition