Using Comments

 

Comment is a part of your PHP code that will not be translated by the PHP engine. You can use it to write documentation of your PHP script describing what the code should do. A comment can span only for one line or span multiple line.

PHP support three kinds of comment tags :

  1. //
    This is a one line comment
  2. #
    This is a Unix shell-style comment. It's also a one line comment
  3. /* ..... */
    Use this multi line comment if you need to.

Example : comments.php
Source code : comments.phps

<?php
echo "First line <br>"; // You won't see me in the output
// I'm a one liner comment

/*
Same thing, you won't
see this in the output file

*/
echo "The above comment spans two lines <br>";

# Hi i'm a Unix shell-style comment
# Too bad you can't see me
echo "View the source of this file, you'll see no comments here <br>";
?>

Get custom programming done at ScriptLance.com!

 

 

Opening and ending PHP tags PHP MySQL Tutorial : Using Comments PHP Variables
Google
 
Web www.php-mysql-tutorial.com
 
This tutorial is far from perfect so if you have any critiques, questions, comments or problems about this tutorial please tell me. Click here to send your feedback. And if you like this tutorial please link to this site. It will really help a lot :-)
 

 

 



Copyright © 2004 - 2008 www.php-mysql-tutorial.com | Privacy Policy