Web EndMemo

PHP Comments


PHP comments can use /**/, //, #;
<?PHP
//array initilization
$arr = array("one"=>"Monday","two"=>"Tuesday","three"=>"Wednesday",
"four"=>"Thursday",/*"five"=>"Friday",*/"six"=>"Saturday","seven"=>"Sunday");
/*
foreach($arr as $num=>$d) 
{
    echo "$num, $d\n";  #print the value and key
}
*/
?>
/* ... */ used for paragraphs, # and // used for lines and words in a line.

<!-- ... --> can also comment out PHP code inside:
<!--
<?PHP
//array initilization
$arr = array("one"=>"Monday","two"=>"Tuesday","three"=>"Wednesday",
"four"=>"Thursday","five"=>"Friday","six"=>"Saturday","seven"=>"Sunday");
echo "PHP comments tutorial\n";
?>
-->

To make sure the PHP code will not execute, /* */ can be used again: <!-- ... --> can also comment out PHP code inside:
<!--
<?PHP
/*
//array initilization
$arr = array("one"=>"Monday","two"=>"Tuesday","three"=>"Wednesday",
"four"=>"Thursday","five"=>"Friday","six"=>"Saturday","seven"=>"Sunday");
echo "PHP comments tutorial\n";
*/
?>
-->