OUR MUST POPULAR POST

Thursday, April 11, 2013

Comments

Comments areas are wonderful for making notes within your coding no matter what language you are currently using. It helps you organize your coding for editing or reading purposes. Comment areas are not "seen" visibly on the web page. They are simply coding notes.

There are two different types of comment tags. One type will comment out a single line of coding, the other will comment out a block of coding lines.

Single lines of coding may be commented using two slashes // or using a hash # symbol. This type of commenting may be used to comment out a full line, or the remainder of a line.


<?php

// This is an example of commenting.

# This is also an example of commenting.

echo "This text will appear on the web page. <br />";

// echo "This text will not appear.";

echo "Some more example text."; // That prints, not this.

?>

Outcome :
This text will appear on the web page.
Some more example text.

Commenting more than one line of coding is done using /* and */. Everything between these two tags will be commented. They can be used on a single line to many lines.

<?php

echo "This is a commenting test below. <br />";

/*
echo "This text will not appear.";
echo "Neither will this.";

*/

echo "This is a commenting test above.";

?>

This is a commenting test below.
This is a commenting test above.

No comments:

Post a Comment

Thanks for comment me