PHP Quick Plus Plus

by Carey on October 11, 2010

Post image for PHP Quick Plus Plus
  • Share
  • CevherShare
  • Share

This is for the beginners…

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

$i = 17;
$i++;
echo $i; // prints "18"

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:

$i = 88;
$i--;
echo $i; // prints "87"

Leave a Comment

Previous post:

Next post: