Friends in need can refer to the more commonly used special operation symbols and functions in PHP (including annotation symbols, common symbol escapes, operation symbols, assignment operators, bit operations, logical operations, and others).
The more commonly used special operation symbols and functions in PHP (including annotation symbols, common symbol escapes, operation symbols, assignment operators, bit operations, logical operations, and others), friends in need can refer to it. 1. Annotation symbols //Single line annotation Multi-line comments Use of quotation marks ' ' Single quote, simple string, taken directly without any processing; " "Double quotation marks, PHP dynamic processing and then output, generally used to process $ variables. Boolean variables: One is true, that is, true; The other is false, which is false Common variables: string string (numbers, Chinese characters, etc.) integer integer (1, 2, 3, 4, 5, 0, -1, -2, etc.) double floating point number (decimal point) array array object object The methods that can be used are gettype($mix) and settype($mix,$typename); 2. Escape common symbols " Double quotes \ backslash n new line r Return to the beginning of the line t horizontal tab 3. Operation symbols + addition operation - subtraction operation *Multiplication/division operations % Take the remainder ++ Add 1 to yourself -- Decrement by 1. Concatenate two strings 4. Assignment operation = Substitute the value on the right into the value on the left += adds the value on the right to the left -= Decrease the value on the right to the left *= Multiply the value on the left by the value on the right /= divide the value on the left by the value on the right .= Add the string on the right to the left 5. Bit operations & Bitwise AND | Bitwise OR ^ Bitwise exclusive OR (xor) > Shift right 1 position ~ Complement number 6. Logical operations greater than = greater than or equal to != is not equal to && and || or ! Not 7. Other operation symbols $ variable symbol & variable alias @ Do not display error information (added before the function) -> Object methods or properties => element value of array ?: ternary operator 1 2 Next page Last page |