A variable can be assigned value multiple times.
Let's look at this example:
Output:
In this case $num has been assigned value multiple times.
$num
Variables can be assigned values of other variables (line 9).
line 9
Also a variable can receive a new value by using it's current value (line 10).
line 10
They assign values and make the code shorter.
$num += 2 is the same as $num = $num + 2.
$num += 2
$num = $num + 2
Example:
$num -= 5 is the same as $num = $num - 5.
$num -= 5
$num = $num - 5
$num *= 7 is the same as $num = $num * 7.
$num *= 7
$num = $num * 7
$num /= 10 is the same as $num = $num / 10.
$num /= 10
$num = $num / 10