Consider these two folder structures:
Foo/
Folder1/
File1.txt
Folder2/
Folder3/
File2.txt
Bar/
Folder1/
Folder2/
Folder3/
Folder4/
I'd like to know the most efficient way in PHP to tell me that the "Foo" folder has two files in it and that the "Bar" folder has zero files in it. Notice that it's recursive. Even though the "File1.txt" file is not immediately inside the "Foo" folder, I still want it to count. Also, I don't care what the names of the files are. I just want the total number of files.
Any help would be appreciated. Thanks!