1) Addition + Adds two Numbers.
2)Subtraction – Subtract two Numbers.
3)Multiplication * Calculate product of two numbers.
4)Division / Divides two numbers.
5)Modulus % Divides by others.
6)Increment ++ Increments the numbers applied by 1.
7)Decrement — Decrement the numbers applied by 1.
PHP also supports the comparison operators which compares two or more values to determined which values is greater ,lesser , equal or not equal to the other.
Greater than >
Less than <
Greater than equal to >=
Less than equal to <=
Equal to = =
Not equal to ! =
PHP supports the logical operators that you can use to create Boolean expressions.Boolean expressions return either True or False.
OR | |
Assignment and Compound operators:
We can use assignment operators in PHP to assign values to the variables .PHP also supports compound operators that perform the functions of the arithmetic and assignment operators in a single statement.
Operators Implements Description
= a=5 Assigns the value, 5, to the variable ,a
+= a+= Adds the value ,5 , to original value of the variable a and then assigns sum to the variable , a .this is equivalent to a=a+5
-= a-= subtract the value
*= a*= Multiply the value
/= a/=5 Divides the value in the variable.
%= a%=5 Divides the value in the variable