[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
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++
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
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
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
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
6 matches
Mail list logo