Comments in php

Comments are used for documenting the code for developer’s reference. The lines within the comments are not executed. PHP comments are similar to the C programming language.
There are two types of comments in PHP:

  • ‘//’ is used to comment out a single line
  • A block of lines should be contained within ‘/*’ and ‘*/’ to comment them.
1
2
3
4
5
6
7
8
9
10
11
12
<?php
//Single line comment
?>
 
<?php
/*
This is
How a
PHP comment block
Looks like
*/
?>
Share Article/Example:
  • DotNetKicks
  • DZone
  • StumbleUpon
  • Print
  • Add to favorites
  • Digg
  • del.icio.us
  • Twitter
  • Facebook
  • LinkedIn
  • Posterous
  • Slashdot

 

 
eXTReMe Tracker