On 31-12-2009 at 04:44:34 romtek <rom...@gmail.com> wrote:
Thank you very much for this sample! It's much more elegant, easier to
understand and maintain than what I've come up with. Things like this had
better be published in a special section of documentation. And I hope
array_chunk() doesn't copy data needlessly. This method does introduce
Kornel, what would you do if data were a collection but not an array
(besides using something like what was suggested by Rasmus Schultz at
If it's small enough to fit in memory, then probably conversion to array
with iterator_to_array() will be fastest.
Otherwise you could write something like IteratorIterator
http://www.php.net/IteratorIterator that ignores reset() and pretends it
ends every n elements.
PHPTAL mailing list