The -= operator is shorthand for subtracting a value from the variable:
$x -= 1;
$x = $x - 1;
Here's some of the other ones:
$x += 1; ($x = $x + 1)
$x -= 1; ($x = $x - 1)
$x *= 1; ($x = $x * 1)
$x /= 1; ($x = $x / 1)
7
votes
It's a shorthand to save typing. It's effect is idential to
$page = $page - 1;
1
votes
The -= operator is a combination arithmetic and assignment operator. It subtracts 1 then reassigns it to $page.
1
votes
It's the same as $page = $page - 1, $page-- or --$page, it's used to decrement the value of the variable.
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more