PHP comments

, by Prashant Gunjal

PHP comments are just same as c or c++ comments .// is use for single line comment and /*   */ is use for multiline comment.

Program :
<html>
<head>
    <title>PHP comments</title>
</head>
<body>
<?php
//this is single line comment
    $no1=20;
    $no2=10;
    $no3;
    $no3=$no1+$no2;
    echo "<br>Addition is = $no3";
    /*$no3=$no1-$no2;        MULTILINE COMMENT
    echo "<br>Substraction is = $no3";
    $no3=$no1*$no2;
    echo "<br>Multiplication is = $no3";
    $no3=$no1/$no2;
    echo "<br>Division is = $no3";
    $no3++;
    echo "<br>Postincrement of no3 is = $no3";
    echo "<br>Original no is = $no3 and preincrement is = ".++$no3;
    $no3--;
    echo "<br>Postdecrement of no3 is = $no3";
    echo "<br>Original no is = $no3 and predecrement is = ".--$no3;*/
?>
</body>
</html>

OUTPUT :


0 comments: