Re: [PHP] Getting an advanced foreach to work

2006-05-23 Thread Greg Beaver
Chris wrote: > Jonas Rosling wrote: > > ... > >> while ($count < count($salespersons)) { > > > I see you have solved it - just one comment. > > This particular line will get evaluated every time. If you have a large > number of elements in $salespersons, it will slow things down considerably.

Re: [PHP] Getting an advanced foreach to work

2006-05-23 Thread Chris
Jonas Rosling wrote: ... while ($count < count($salespersons)) { I see you have solved it - just one comment. This particular line will get evaluated every time. If you have a large number of elements in $salespersons, it will slow things down considerably. From a performance point of vie

Re: [PHP] Getting an advanced foreach to work

2006-05-23 Thread cajbecu
this shoul work: while ($count < count($salespersons)) { foreach ($salespersons[$count] AS $key => $value) { echo htmlentities($key).' - '.$value; $count++; } } On 5/23/06, Jonas Rosling <[EMAIL PROTECTED]> wrote: I got the code as follows