PHP operator Category Overview _ PHP Tutorial

Source: Internet
Author: User
Tags php operator
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...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.