I am new to PHP and have a question about how to index a directory and their sub-directories. I have searched the forum and found a few posts on "recursive directory listing", and that is just what I would like to do. But, in all the examples i found (in the forum and in the code library) there was not a single one that counted the files in each directory. I have tried to implement this myself, but always ended up with really weird results. In short, I would like the php script to list all directories, and the number of files in them. Some thing like this.
StartDir/ 5 files, 2 subdirs
OneDirInStartDir/ 4 files, 0 subdirs
AnotherDirInStartDir/ 230 files, 1 subdir
OneDirInSubDir/ 3 files, 0 subdirs.
If anyone could help me with this I would be glad!! (a working php snipped would be of great help, since i'm a newbie.)
Thanks in advance
/Jens