PHP
Assignment Operators

PHP assignment operators are used to assign or process with numeric values. The basic assignment operator in PHP is “=”. It means that the left operand gets set to the value of the assignment expression on the right.

OperatorNameExampleResult
=Equal$a = $bAssign the $b value to $a.
+=Addition$a+=$bAdd the value of $b to $a and store the result in $a.
-=Subtraction$a-=$bSubtract the $b value from $a. and store the result in $a.
*=Multiplication$a*=$bMultiply the $a and $b value. and store the result in $a.
/=Division$a/=$bDivide with $a by $b. and store the result in $a.
%=Modulus$a%=$bremainder of $a divided by $b. and store the result in $a.