Summary of basic PHP operators. PHP is one of our development languages. it has powerful functions. This article will introduce PHP operators to friends who like PHP. Like other advanced languages, PHP has many PHP operators. The PHP package is one of our development languages. it has powerful functions. This article will introduce PHP operators to friends who like PHP. Like other advanced languages, PHP has many PHP operators. Including arithmetic operators, value assignment operators, string operators, auto-increment and auto-subtraction operators, logical operators, bitwise operators, and relational operators.
1. arithmetic operators
PHP arithmetic operators include + (plus),-(minus), * (multiplication),/(division), and % (remainder ).
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 ).
3. string operators
The PHP string operator only has the concatenation symbol ".", which connects two strings.
4. Auto-incrementing auto-subtraction operator
PHP auto-increment and auto-increment operators have four forms: $ a ++; ++ $ a; $ a --; -- $.
5. logical operators
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 ).
& | The priority is higher than and or.
6. bitwise operators
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 ).
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 ).
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 ).
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.
Bytes. Like other advanced languages, PHP has many PHP operators. Package...