Re: [PHP] loop Q

2006-02-24 Thread Jochem Maas
[EMAIL PROTECTED] wrote: William Stokes wrote: What does this do in a for loop? $counter+=1 I read it as if he'd come across this: for ($counter=0; $counter<$stopper; $counter+=1) { ... lots of code ... $counter+=1; } Which, I think, would increment the counter twice on each pass thr

Re: [PHP] loop Q

2006-02-24 Thread William Stokes
Cheers! "Jochem Maas" <[EMAIL PROTECTED]> kirjoitti viestissä:[EMAIL PROTECTED] > William Stokes wrote: >> What does this do in a for loop? >> >> $counter+=1 >> > > it's shorthand for $counter = $counter + 1; > which in this case (because 1 is being added) > can also be written as: > > $counter++

Re: [PHP] loop Q

2006-02-24 Thread Jochem Maas
William Stokes wrote: What does this do in a for loop? $counter+=1 it's shorthand for $counter = $counter + 1; which in this case (because 1 is being added) can also be written as: $counter++; or ++$counter; those last 2 alternatives give the same result but they are _not_ exactly equiva

Re: [PHP] loop Q

2006-02-24 Thread ÃmìtVërmå
It depicts $counter = $counter+1; William Stokes wrote: What does this do in a for loop? $counter+=1 Thanks -Will -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] loop Q

2006-02-24 Thread Duncan Hill
On Friday 24 February 2006 10:34, William Stokes wrote: > What does this do in a for loop? > > $counter+=1 Increments $counter. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] loop Q

2006-02-24 Thread William Stokes
What does this do in a for loop? $counter+=1 Thanks -Will -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php