PHP תומכת בסיגנון ההערות של שפת C, C++ ומעטפת יוניקס. לדוגמה:
<?php echo "This is a test"; // This is a one-line c++ style comment /* This is a multi line comment yet another line of comment */ echo "This is yet another test"; echo "One Final Test"; # This is shell-style style comment ?> |
הערת ה "one-line" תכלול את כל הטקסט עד סוף השורה או עד תגית סגירה של PHP.
<h1>This is an <?php # echo "simple";?> example.>/h1> <p>The header above will say 'This is an example'. |
הזהר לא לקנן הערות בסגנון 'C' אשר יגרמו לבעיה כאשר תרצה להפוך בלוק גדול של קוד להערה