04-15-2009, 08:06 PM
|
#1 (permalink)
|
|
The Gregarious
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
|
Increment, decrement....
Hey guys,
Got a newbie and embarrassing question....
I thought that the ++ would add 1 to a number? Like so:
Code:
$test = 1;
$test2 = $test++;
echo "OUTPUT: $test2";
The output is still 1. I thought that the output should be 2?
Is the only way to use the ++ is in loops?
I thought that the ++ was a quick way to add "1" without having to do this:
$test2 = ($test + 1);
|
|
|
|