Showing posts with label PHP Comments. Show all posts
Showing posts with label PHP Comments. Show all posts

Monday, October 10, 2011

How many types of comments are there in PHP?

There are two types of comments in PHP. They are
  1. One Line comments (// or #)
  2. Multiple Line comments (/* */)
The "one-line" comment styles only comment to the end of the line or the current block of PHP code, whichever comes first.
Eg:
      
     <?
      // echo 'Your code upto end of the line'; 
     ?>
     <?
     # echo 'Your code upto end of the line';  
     ?> 

Multiple Line comments (/* */) are used to comment a large block of PHP code.
Ex: <?
 /*
    echo 'This is a test';
    echo 'This is a test line2';
       echo 'This is a test line 3';
 */
?>