Your right, I may end up changing the routine to a nested loop of some kind to catch the end of the list.
Your example brings to mind something I've been wanting to ask someone for a long time.
I read a post on php.net about 2 years ago I think, where some guy benchmarked, do, for, foreach and while. The slowest was for when it came to speed and do being the fastest. If I remember correctly do is 60% faster than for. Since then, I stopped using for statements unless dealing with very small arrays. I try to trim off any excess load that I can.
Have you noticed any speed difference between any of these?
-
|