Log in

View Full Version : Question about +=



alexjewell
08-27-2006, 11:42 PM
A friend of mine saw "+=" in a script and asked me what it meant.
I searched php.net and google and everything, and I've come up empty handed.
"plus equals"???
I don't get it.
Explain?

blm126
08-27-2006, 11:48 PM
Here is an example


<?php
$num = 5;
$num += 10;
echo $num
?>

that will produce 15. it is equivalent to


<?php
$num = 5;
$num = $num + 10;
echo $num
?>