I vaguely remember running into this problem before, but I'm wondering if this just doesn't work in PHP:
echo $counter; // outputs 4
$output = $counter--;
echo $output; // outputs 4
If I do something like:
$output = $counter - 1;
I have no problems whatsoever.
Can someone shed some light on this?
Thanks, Ryan
What you want is the pre-decrement operator:
echo $counter; // outputs 4
$output = --$counter;
echo $output; // outputs 3