SV: Getting an advanced foreach to work

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




-----Ursprungligt meddelande-----
Från: Chris [mailto:dmagick@xxxxxxxxx]
Skickat: den 23 maj 2006 10:24
Till: Jonas Rosling
Kopia: PHP List
Ämne: Re:  Getting an advanced foreach to work


> From a performance point of view you're much better off doing:

> $sales_count = count($salespersons);

> while($count < $sales_count) {
> ....

> The only reason to leave the count in the while statement is if you are
> adding/removing to that array within the loop, otherwise chuck it in a
> temp variable and use that instead.

Thansk alot for the tip.

// Jonas

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux