| Operator |
Info |
Example |
| = |
Placing right side to left side |
$r = 87 |
| += |
Enhancing right side to left side |
$r += 42 |
| -= |
Tapering down right side to left side |
$r -= 10 |
| *= |
Multiply right side to left side |
$r *= 2 |
| /= |
Allot right side to left side |
$r /= 7 |
| %= |
Putting down the result of modulus between left side variable value with right side value in left |
$r %= 1 or $r : = $r % 2 |
| &= |
Putting down the result of operation the "AND" operator to the left side variable value with right side value in left. |
$x &= $y or $x :=$x & $y |
| |= |
Putting down the result of operation the "OR" operator to the left side variable value with right side value in left |
$x |= $y or $x : = $x | $y |
| ^= |
Putting down the result of operation the "XOR" operator to the left side variable value with right side value in left |
$x ^= $y or $x : = $x ^ $y |
| .= |
Putting down the result of operation the "CONCAT" operator to the left side variable value with right side value in left |
>$x .= "more text" or $x : = $x."more text" |
Pay attention to the example of using assignment operator at script as following:
File name: assignmentoperator1.php