What is Assignment operators?
PHP Assignment operators are used to assign values to variables. The right side value is substituted for the left side value in the operand variable. Operators in this category are in charge of assigning variables. The most frequent assignment operator is =, which assigns the operand’s right side to the left variable.
- Assignment Same as… Description
x = y x = y
The left operand gets set to the value of the expression on the rightx += y x = x + y
Additionx -= y x = x - y
Subtractionx *= y x = x * y
Multiplicationx /= y x = x / y
Divisionx %= y x = x % y
Modulus
Example:-
Output:-