PHP syntax: Three Comment Styles

Contributor Icon Contributed by qmchenry  
Tag Icon Tagged: PHP programming  

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



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).

 

No Comments -


No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment -