Rafael Dohms has posted the first part of a series he's writing looking at the Iterators that come with the Standard PHP Library (SPL). In this first article he focuses on Directory iterators.
Wouldn't it be nice if you could go by life just applying a foreach to each year and life day by day? Ok, that was an awful joke, but using iterators does make life a lot easier and fun, and that's without mentioning cleaner code. SPL's iterator classes are really awesome and helpful, replacing multiple lines of code and a handful functions with a simple new this and a foreach can really help cleaning up code.