Answers for "php decrement variable by 1"

PHP
0

php increment variable by 1

$variable++;
Posted by: Guest on February-02-2021
0

php decrement variable by 1

$variable--;
Posted by: Guest on February-02-2021
0

php decrement variable

$var = 1;
// use value (1) THEN decrement by one
$var--;
// decrement by one THEN use value (0)
--$var;

// aside: decrement by custom amount (1 emulates the above)
$var -= 1;
$var -= $step;
Posted by: Guest on February-17-2021

Browse Popular Code Answers by Language