04-15-2009, 09:02 PM
|
#2 (permalink)
|
|
The Frequenter
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 438
Thanks: 3
|
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.
|
|
|
|