Stop reinventing the loop

Looping over collections is something all programmers do. We keep writing the same code and building the same loops in project after project. PHP has us covered though. We don't have to continue to re-invent the loop, we can use the tools provided.

The Standard PHP Library (SPL) gives you the tools you need

An important part of the SPL is the collection of Iterator classes and interfaces. These bits of magic, like the rest of the SPL, will change the way you program. They are power tools in every PHP programmer's toolbox. Like other power tools, if used safely, they can make a difference in how you code, and how fast.

Iterators help you create better programs, "Iterating PHP Iterators" will help you create iterators

"Iterating PHP Iterators" will show you the basic of PHP's Iterators. You will see how to implement them in your own code, as well as use them to do eveyrthing form filtering input to stupid party tricks.

This is a great book for beginners and intermediate developers. It’s a comprehensive introduction to iterators and some of the implementations that ship with the SPL. - Christopher Pitt (Iterating PHP Iterators Review)

Easy start for beginners, but enough meat for those who already use Iterators - Mark (@Mark_Baker) Baker

#IteratingPHPIterators by @CalEvans is a great quick reference book if you use them regularly, or a good starter if you haven’t - Ian (@icawebdesign) H.

Finished @CalEvans 'Iterating PHP Iterators'. Nice read. Should use them more often, especially to filter when looping.#php - Stefan (@stefan_doorn) Doorn

"Iterating PHP Iterators" is part of the "Learn One Thing Books" series.