PHP syntax: comments

Home -> Programming -> Web -> PHP

7326 views

From the computer of: qmchenry (339 recipes)
Created: Dec 28, 2003     Updated: Jun 19, 2006


0 comments:
View all comments

Add a comment

Add to:
Add to stumbleuponAdd to del.icio.usDigg itAdd to FURL

PHP allows three forms of comments all of which may seem familiar to programmers of other languages.



/* comment block
everything within the slash-asterisk
pairs is commented */


Two inline comment styles cause everything following to be ignored:

$var++;  // increment var
$var=2;  # another comment


Comments don't work when they are in quotes (otherwise we couldn't use a # in the output of an echo statement).

Subscribe to the Tech-Recipes Newsletter

You can get tips like this delivered in your email every week!

Enter your Email

We will never, ever sell your email address or spam you.





Related recipes:

  PHP syntax: for loop basics
  PHP: Rename or move a file on the server
  PHP conditional syntax: inequality
  PHP syntax: iterate over an associative array
  PHP conditional syntax: less than
  PHP syntax: create an associative array
  PHP syntax: iterate over an array
  PHP comparison syntax: equality
  PHP conditional syntax: greater than
  Redirect to another web page using PHP

 

Sponsored links

 

Login

Nickname

Password

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.