PHP Tutorial : Comments in php code

Commenting php code can be done in 3 ways. There are 3 different signs of commenting code in php.
First option is with sharp sign “#”. Like here:

#this is a comment
?>

The second option is with a double backslash “//”

//this is another a comment
?>

Last option is the use of a backslash and this sign * like “/*” and end it with “/*”

/*this is a comment on line 1
continued comment
extended comment
end of comment */
?>
This entry was posted in Basic PHP and tagged , , , , . Bookmark the permalink.

2 Responses to PHP Tutorial : Comments in php code

  1. bogdan says:

    The last one ends in */

  2. admin says:

    yes I know, you’re the 2nd person observing, thanks
    ps : when writing on blog with no code/coloring or autocomplete feature like in Zend IDE it happens to make mistakes

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>