PHP Quick Plus Plus

by Carey on October 11, 2010

Post image for PHP Quick Plus Plus

This is for the beginners…

A nice and simple way to increase an integer variable by 1:

{code type=php}
$i = 17;
$i++;
echo $i; // prints “18”
{/code}

I am sure most of you know this one but if you don’t then of course it is very useful. It also works with subtraction:

{code type=php}
$i = 88;
$i–;
echo $i; // prints “87”
{/code}

Leave a Comment

Previous post:

Next post: