PHP Operators

Arithmetic

5 + 3 = 8

5 - 3 = 2

5 * 3 = 15

5 / 3 = 1.6666666666667

5 % 3 = 2

5 ** 3 = 125

Assignment

5 = 3 = 3

3

+= 3 = 6

6 -= 3 = 3

3 *= 3 = 9

9 /= 3 = 3

Comparison

This is true.

Increment / Decrement

1. 1
2. 6
3.1. 2
4. 5

Logical

true that both a and b are true
true that both a and b are true
true that a or b is true
true that a or b is true

String

$ a . $ b : String concatenation (joining)

HelloWorld

$ a .= $ b : Appends $ b onto $ a

HelloWorld