$var = 0;
// use value (0) THEN increment by one
$var++;
// increment by one THEN use value (1)
++$var;
// aside: increment by custom amount (1 emulates the above)
$var += 1;
$var += $amount;
// Php increment and decrement: Just print it then understand
$n =9;
echo $n++;
echo PHP_EOL;
echo ++$n;
echo PHP_EOL;
echo --$n;
echo PHP_EOL;
echo $n--;
echo PHP_EOL;
echo "Another Example======
";
$a = 7;
$b = $a++;
echo $b."
".$a;
// To increment a variable by 1
$var++;
$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;