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.
Operator | Name | Example | Result |
---|---|---|---|
= | Equal | $a = $b | Assign the $b value to $a. |
+= | Addition | $a+=$b | Add the value of $b to $a and store the result in $a. |
-= | Subtraction | $a-=$b | Subtract the $b value from $a. and store the result in $a. |
*= | Multiplication | $a*=$b | Multiply the $a and $b value. and store the result in $a. |
/= | Division | $a/=$b | Divide with $a by $b. and store the result in $a. |
%= | Modulus | $a%=$b | remainder of $a divided by $b. and store the result in $a. |