PHP operator Category overview. PHP operator 1. arithmetic operators PHP arithmetic operators include + (plus),-(minus), * (multiplication), (division), and % (remainder ). PHP operator 2. Assignment operator PHP assignment operator + (add the value on the left to the right
PHP operator 1. arithmetic operator
PHP arithmetic operators include + (plus),-(minus), * (multiplication),/(division), and % (remainder ).
PHP operator 2. value assignment operator
PHP assignment operators include + = (assign the value on the left plus the value on the right to the left) and-= (assign the value on the left minus the value on the right to the left), * = (multiply the value on the left by the value on the right to the left),/= (divide the value on the left by the value on the right to the left), % = (assign the remainder value of the left value to the left ),. = (connect the left string to the right and assign it to the left ).
PHP operator 3. string operator
The PHP string operator only has the concatenation symbol ".", which connects two strings.
PHP operator 4. Auto-increment auto-subtraction operator
PHP auto-increment and auto-increment operators have four forms: $ a ++; ++ $ a; $ a --; -- $.
PHP operator 5. logical operator
PHP logical operators! (Logical not), and (logical and), & (logical and), or (logical or, if either of the two expressions is true, the result is true), | (logical OR), xor (exclusive or, two expressions have and only one is true, the result is true ).
And | has a higher priority than and or.
PHP operator 6. bitwise operator
Bitwise operators convert all numbers into binary numbers for calculation.
Bitwise operators include & (bitwise AND), | (bitwise OR), ^ (bitwise OR), <(shifts left by bitwise), and> (shifts right by bitwise) ,~ (Bitwise inversion ).
PHP operators 7. relational operators
Relational operators include = (equal to) and ),! = (Not equal to), <(less than),> (greater than), <= (less than or equal to),> = (greater than or equal ).
PHP operator 8. Other operators
PHP operators include some operators, such as $ (variable symbol), & (variable pointer, get address), @ (no error message is displayed before the function), and ),? (Three-object operator), (comma operator),-> (object method and attribute), => (array assignment ).
PHP operator 9. operator priority
The PHP operator has a priority. when multiple operators are combined, the PHP operator has a higher priority first. A simple understanding is to multiply, divide, and add or subtract the code. I will not describe it here.
Arithmetic. arithmetic operators PHP arithmetic operators include + (plus),-(minus), * (multiplication),/(except), and % (remainder ). PHP operator 2. Assignment operator PHP assignment operator + = (add the value on the left to the right...