php basic syntax rules
1.1. PHP tags
PHP language is a background processing language (program) that can be embedded in "html" code
There are several markup forms as follows, only the first one is recommended.
1,
This is the recommended way to write!
2,
3, PHP code is written here.... ?>
Need to configure in php.ini: short_open_tag = On //The default is Off, which means that this form cannot be used.
Note:
Pure PHP code: the end of the tag can be omitted.
Later, we will write a lot of "pure php code files" (without any html code in them).
1.2. PHP statement terminator
Use English semicolon (;) to indicate the end of a statement.
1.3. PHP comments
1.3.1. Single line comment:
Two slashes: //The part after the slash is the comment content , the PHP language will not process it (not execute)
1.3.2. Multi-line comments:
Form:
/* 这是注释内容。。。 可以写多行 */ /* 当然写一行也是可以的 */
Important things Yes: Comments are a very important factor and habit in writing programs!
For more PHP knowledge, please visit PHP Chinese website!
The above is the detailed content of PHP basic grammar rules. For more information, please follow other related articles on the PHP Chinese website!