Learn PHP - PHP Syntax Overview
Each code line in PHP must end with a semicolon. The semicolon is a separator and is used to distinguish one set of instructions from another. The file must have a .php extension. If the file has a .html extension, the PHP code will not be executed.
A comment is the portion of a program that exists only for the human reader and stripped out before displaying the programs result. There are two commenting formats in PHP:
Single-line comments: They are generally used for short explanations or notes relevant to the local code. Here are the examples of single line comments.
Single-line comments: They are generally used for short explanations or notes relevant to the local code. Here are the examples of single line comments.
<?
# This is a comment, and
# This is the second line of the comment
// This is a comment too. Each style comments only
print “An example with single line comments”;
?>
# This is a comment, and
# This is the second line of the comment
// This is a comment too. Each style comments only
print “An example with single line comments”;
?>