There are two main types of PHP comments. The ﬁ rst type is for commenting a single line or partial line. The comment starts with a // and ends at the end of the line. The second type of comment is a block comment. The block comment starts with a /* and ends with a */.
// This is a single line comment
$temperature = 65;
$celsius = ($temperature – 32)* (5/9);
// this is also a valid comment
echo “<p>The answer is ” . $celsius .” </p>”;
/* This is an example of using a multiple line comment.
With this type of comment you don’t need to keep repeating the comment code. */
$temperature = 65; $celsius = ($temperature – 32)* (5/9);
/* this is also a valid comment */
echo “<p>The answer is ” . $celsius . “</p>”;