by leftnode · 17y ago · 0 comments
Then, you loop through it again with the foreach. What if you wanted to paginate those results quickly? What if you only wanted a subset of the whole pie?
This class, as I'll show in a future article, can easily be extended to allow for easy pagination and filtering of your data.
BTW I did a test, and it seems that $array[] is a faster way to append.
Classic PHP-style micro-optimization. If you can't use the right algorithm, you can at least make the wrong one run 0.34% faster.