View Single Post
Old 04-15-2009, 09:02 PM   #2 (permalink)
xenon
The Frequenter
Newcomer 
 
xenon's Avatar
 
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 438
Thanks: 3
xenon is on a distinguished road
Default

You meant this:

Code:
$a = 1;

$b = ++$a;

echo $b; // 2

//----------------//
// ...or... 
//----------------//
$a = 1;

$a++;

$b = $a;

echo $b; // 2
$var++ first returns the value of the variable, and then increments it, whereas ++$var first increments the variable, and then returns its value.
__________________
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.
xenon is offline  
Reply With Quote