php increment variable by 1

34

// 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======\n";


$a = 7;
$b = $a++;

echo $b."\n".$a;

Comments

Submit
0 Comments