Your Ad Here

 Navigation

Home
Source code
Tutorials
RSS feeds
Articles
Books
Software
Downloads
Hosting
manuals
Forums
Script directory
Training
Our Links

 Sponsors
 Links
dropshippers
dvd information
finance products
 Downloads
 Misc

Webmaster Resources
Only PHP
ScriptSearch.com
Scripts.com - Get the best scripts NOW!
AndreaPHP Programming



Comments


Comments

Comments are pieces of code that the PHP parser skips. When the parser spots a comment, it simply keeps going until the end of the comment without doing anything. PHP offers both one line and multi-line comments.

 

One-Line Comments

One-line comments are comments that start where ever you start them and end at the end of the line. With PHP, you can use both // and # for your one-line comments (# is not commonly used). Those are used mainly to tell the reader what you're doing the next few lines. For example:

//Print the variable $message
echo $message;
    

It's important to understand that a one-line comment doesn't have to 'black out' the whole line, it starts where ever you start it. So it can also be used to tell the reader what a certain variable does:

$message = ""; //This sets the variable $message to an empty string
    

The $message = ""; is executed, but the rest of the line is not.

 

Multi-Line Comments

This kind of comment can go over as many lines as you'd like, and can be used to state what a function or a class does, or just to contain comments too big for one line. To mark the beginning of a multiline comment, use /* and to end it, use */ . For example:

/* This is a
   multiline comment
   And it will close
   When I tell it to.
 */
    

You can also use this style of comment to skip over part of a line. For example:

 $message = ""/*this would not be executed*/;
    

Although it is recommended that one does not use this coding style, as it can be confusing.

 

All text is available under the terms of the GNU Free Documentation License
Source : Wikibooks




Books
 Sponsors
 Random Code
Display when a page was last modified(date/time)

Time based greeting(date/time)

GD email address(internet)

 Random Article
  Network

Programming resources
Tutorials directory
General bid directory
sell software, make money
Find me wholesalers
Find me dropshippers
Free recipes online/a>
UK products and price comparison
Anime videos
Free lyrics search
free stuff
UK stores
Gambling directory
Sexy free wallpapers
Hosting resources
ASP site
Golf resources
iPod resources
Coupons and deals
Baby names
Domain names
Dating site
Scripts directory
Maxi directory
bigarticle : free articles
dawgwitch search
List of directories






beginners PHP Copyright © 2004 onwards by beginnersPHP.