Home  >  Article  >  Backend Development  >  First introduction to php_PHP tutorial

First introduction to php_PHP tutorial

WBOY
WBOYOriginal
2016-07-15 13:21:29829browse

PHP: Hypertext Preprocessor (Hypertext Preprocessing Language), server-side script.

1. Opening and closing tags, there are 2 common php tags:

and


2. Note: Almost the same as ordinary language

3. Data type:

Four scalar types: boolean, integer, float (also called double), string

boolean: zero or empty is false, others are true

string: A character is a byte, and there are four definition methods.


Two composite types: array, object

array: key value collection, only integer and string can be used as keys

object:

Two special types: resource, NULL

resource: Resource is a reference to an external resource.

Variable definitions do not support explicit type definitions, which are determined by PHP at runtime based on the context in which the variable is used.


4.Variable

dollar match + variable name, case sensitive

Variable variables look similar to two-dimensional arrays, but I didn’t look carefully.

Magic constant, sounds very special.


5. Control structure

if-else: Same as high-level language, but with alternative syntax. It is not required to master, but you should understand the code

while, for: loop

break ends the execution of the current for, foreach, while, do-while or switch structure. break can accept an optional numeric argument to determine how many loops to break out of.


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/477200.htmlTechArticlePHP: Hypertext Preprocessor (Hypertext Preprocessing Language), server-side script. 1. Opening and closing tags, there are two common php tags: ?php? and script language=php/script 2. Comments:...
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