Giải pháp thiết kế web động với PHP - p 8
HOW TO WRITE PHP SCRIPTS
Combining calculations and assignment
PHP offers a shorthand way of performing a calculation on a variable and reassigning the result to the variable through combined assignment operators. The main ones are listed in Table 3-3. Table 3-3. Combined arithmetic assignment operators used in PHP Operator += -= *= /= %= Example $a += $b $a -= $b $a *= $b $a /= $b $a %= $b Equivalent to $a = $a + $b $a = $a - $b $a = $a * $b $a = $a / $b $a = $a % $b
Adding to an existing string
The...