Combined Assignment Operators : Assignment Operators « Operator « PHP






Combined Assignment Operators

 
<?
$x = 4;
$x = $x + 4; // $x now equals 8


//can instead be written as



$x = 4;
$x += 4; // $x now equals 8
?>
  
  








Related examples in the same category

1.Assignment Operators demo
2.Combined assignment and addition
3.Combined assignment and concatenation