Simplest and best iterator definition:
Iterators are PHP’s way of dealing with abstracting away the traversal logic from the business logic. This, in one sentence, sums up what an iterator is. [J. Thijssen : Mastering…, p. 68]
My goal for today is to show you how to use IteratorAggregate with CallbackFilterIterators to filter out files not meeting our requirements.
Feel free to use this class in your own projects.