PHP Comments

PHP Comments are similar to comments c , c++,java and also html. PHP Comments two types have that singe line commants and multi line commants.which main use to serve as a note to you and will not be displayed to your visitors and very use ful to PHP programmers.

PHP Comments - Single line comment

The first type we will discuss is the single line comment.The single line comment use interpreter to ignore all PHP lines . single line comment type is "//" or "#" .

php Single line comment example :

< ?php
//echo "Wel come 1";
#echo "Wel come 2";
echo "Wel come 3";
?>

Out Put :

Wel come 3

The above coding have three Wel come lines .The first line commanted at double slash . second line commanted at hash . finally out put will be on broswer Wel come 3 message.

PHP Comments - multi line comment

The second type we will discuss is the multi line comment.The multi line comment use to ignore all PHP commented lines . multi line comment type is /* */. Which commants also we used c,c++ and java languages.

php multi line comment example :


< ?php
/*echo "Wel come 1";
echo "Wel come 2";*/
echo "Wel come 3";
?>

Out Put :

Wel come 3

The above coding have three Wel come lines .The first 2 line commanted at slash star . finally out put will be on broswer Wel come 3 message and ignore the Wel come 1 and Wel come 2 messages.