Home > Backend Development > PHP Problem > PHP basic grammar rules

PHP basic grammar rules

藏色散人
Release: 2023-02-25 18:52:01
Original
3841 people have browsed it

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,

This is the recommended way to write!

2,

3,

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:

/*
这是注释内容。。。
可以写多行
*/
 
/* 当然写一行也是可以的 */
Copy after login

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!

Related labels:
php
Statement of this Website
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template