"; 2. PHP uses an English semicolon to indicate the end of a statement; 3. PHP uses two slashes Bars indicate comments."/> "; 2. PHP uses an English semicolon to indicate the end of a statement; 3. PHP uses two slashes Bars indicate comments.">

Home  >  Article  >  Backend Development  >  PHP basic grammar rules

PHP basic grammar rules

藏色散人
藏色散人Original
2019-10-02 10:27:483722browse

PHP basic grammar rules

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, 4ae91749f96c8dcc9a95a370e37b651e

This is the recommended way to write!

2, f3696ec86b0c1132d757b305c503dfc1 The php code is written here.... 2cacc6d41bbb37262a98f745aa00fbf0

3, 6a8212cdd843a66f5cfab95af6c0eb09

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn