Category Overview of PHP operators _php Tutorial

Source: Internet
Author: User
Tags bitwise operators php operator
PHP operators 1. Arithmetic Operators

The PHP arithmetic operators have + (plus),-(minus), * (multiply),/(except),% (remainder).

PHP operator 2. Assignment operators

The PHP assignment operator has + = (assigns the left-hand value to the left),-= (assigns the left-hand value minus the right value to the left), *= (assigns the left-hand value to the left),/= (assigns the left-hand value to the left),%= ( Leave the value on the left to the left),. = (the left string is concatenated to the right to the left).

PHP operators 3. String operators

The PHP string operator has only a connection symbol ".", which connects two strings.

PHP operator 4. Self-increment auto-decrement operator

There are four types of PHP self-decrement operators: $a + +, + + $a, $a--;--$a.

PHP operator 5. logical operators

PHP logical operators have! (logical non), and (logical AND), && (logical AND), or (logical OR, two expressions as long as one is true, the result is true), | | (logical OR), XOR (two expressions have only one is true, the result is true).

and | | Priority is higher than and and OR.

PHP operator 6. Bitwise operators

Bitwise operators are calculated by converting all the numbers into binary numbers.

Bitwise operators have & (bitwise AND), | (bitwise OR), ^ (bitwise XOR), << (bitwise left), >> (bitwise right SHIFT), ~ (bitwise reversed).

PHP operator 7. Relational operators

The relational operators have = = (equals),! = (not equal), < (less than), > (greater than), <= (less than or equal), >= (greater than or equal).

PHP operator 8. Other operators

The PHP operator also has some operators, such as $ (variable symbol), & (variable pointer, fetch address), @ (added before the function, does not display an error message),?:( The trinocular operator),, (comma operator), (method and property of the object), + = (array Assignment).

PHP operator 9. Operator Precedence

The PHP operator has precedence, and a number of operators are prioritized first. The simple understanding is the first multiplication after the addition and subtraction, here no longer repeat.


http://www.bkjia.com/PHPjc/446323.html www.bkjia.com true http://www.bkjia.com/PHPjc/446323.html techarticle PHP operators 1. The arithmetic operator has a PHP arithmetic operator with + (plus),-(minus), * (multiply),/(except),% (remainder). PHP operator 2. Assignment operator The PHP assignment operator has + = (the left value is added to the right ...).

  • Related Article

    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.