PHP Data Type Operators Control Statement Arrays and Functions

1. Data Type

   Overall division:

    Scalar types: int (integer type), float (floating point type), string (string type), bool (boolean type)

    Composite type: array (array type), object (object type)

    Special types: null (null type), resource (resource type)

   Note: 1. Floating-point numbers cannot be directly compared in size. If you want to compare, you can only convert them to integers based on the precise requirements of your own application.

              2. The single-quote and double-quote strings in php are strings with different details and meanings

              3. Resource types basically refer to references to external data

     innse() determines whether a variable exists

     empty() to determine whether a data is empty

     unset() destroy deletes a variable

      is_xx type() determines whether a data is of a certain type

2. Operators

    1. Arithmetic operators + - * / %++ --

             The difference between before ++ and after ++: before ++: first complete the increment operation of the variable, and then obtain the value of the variable to participate in other operations. Post++: first store the value of the original variable temporarily. Then increment the variable value, and finally use the temporarily stored value to participate in other operations

    2. Comparison operators > >= < <= == != ===

    3. Logical operators && || ! AND OR NOT

    4. String operators: . .=

    5. Assignment operators += -= *= %= .=

    6. Ternary operator data 1 ? Data 2: Data 3   

         The result of data 1 is a boolean value returns true or false If it is true, executes data 2 and if it is false, executes data 3

3. Flow Control Statement

  

 

  • First temporarily store the value of the original variable, then increment the variable value, and finally use the temporarily stored value to participate in other operations.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325344590&siteId=291194637