RecursiveIterator
and its relatives are quite handy in any tree-related situation. Probably the most used is RecursiveDirectoryIterator
for getting all files recursively in a directory. But this family of iterators has some issues to be addressed so that developers do not end up fleeing. First, you must not fear SPL. But there's more. Let's see…