Re[2]: [PHP] Simple: Whats wrong with this?
| From: | Richard Davey | Date: | Wed, 17 Mar 2004 17:07:32 +0000 |
| Subject: | Re[2]: [PHP] Simple: Whats wrong with this? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-180698@lists.php.net to get a copy of this message | ||
Hello Jake,
Wednesday, March 17, 2004, 5:00:52 PM, you wrote:
>> $correct++;
JM> Does this always work? In my timesheet app, I have to do $counter = $counter
JM> + 1, because for some reason the $counter++; doesn't work. It just doesn't
JM> work, no incrementation of the variable. Is there something in php.ini that
JM> can prohibit this from working?
++ is a _post_ increment. This means it'll returns $correct first and
then increment it by one. There is a section in the PHP manual on this
(search for "Incrementing/Decrementing Operators".
--
Best regards,
Richard Davey
http://www.phpcommunity.org/wiki/296.html