I need to get a total count of JPG files within a specified directory, including ALL it\'s subdirectories. No sub-sub directories.
Structure looks like this :
<
A for each loops could do the trick more quickly ;-)
As I remember, opendir is derivated from the SplFileObject class which is a RecursiveIterator , Traversable , Iterator , SeekableIterator class, so, you don't need a while loops if you use the SPL standard PHP Library to retrive the whole images count even on subdirectory.
But, it's been a while that I didn't used PHP so I might made a mistake.