# PHP Operators

Jump to: navigation, search
ICT Applications

### Arithmetic Operators

 Operator Name Description x + y Addition Sum of x and y x - y Subtraction Difference of x and y x * y Multiplication Product of x and y x / y Division Quotient of x and y x % y Modulus Remainder of x divided by y - x Negation Opposite of x a.b Concatenation Concatenate two strings

### Assignment Operators

 Assignment Same as... Description x = y x = y The left operand gets set to the value of the expression on theright x += y x = x + y Addition x -= y x = x - y Subtraction x *= y x = x * y Multiplication x /= y x = x / y Division x %= y x = x % y Modulus a .= b a = a . b Concatenate two strings

### Incrementing/Decrementing Operators

 Operator Name Description ++ x Pre-increment Increments x by one, then returns x x ++ Post-increment Returns x, then increments x by one -- x Pre-decrement Decrements x by one, then returns x x -- Post-decrement Returns x, then decrements x by one

### Comparison Operators

 Operator Name Description x == y Equal True if x is equal to y x === y Identical True if x is equal to y, and they are of same type x != y Not equal True if x is not equal to y x <> y Not equal True if x is not equal to y x !== y Not identical True if x is not equal to y, or they are not of same type x > y Greater than True if x is greater than y x < y Less than True if x is less than y x >= y Greater than or equal to True if x is greater than or equal to y x <= y Less than or equal to True if x is less than or equal to y

### Logical Operators

 Operator Name Description x and y And True if both x and y are true x or y Or True if either or both x and y are true x xor y Xor True if either x or y is true, but not both x && y And True if both x and y are true x y Or True if either or both x and y are true ! x Not True if x is not true

### Array Operators

 Operator Name Description x + y Union Union of x and y x == y Equality True if x and y have the same key/value pairs x === y Identity True if x and y have the same key/value pairs in the same order andof the same types x != y Inequality True if x is not equal to y x <> y Inequality True if x is not equal to y x !== y Non-identity True if x is not identical to y

ICT Applications