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.
?>
// 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.
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.";
?>
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.
This is a commenting test above.
No comments:
Post a Comment
Thanks for comment me