I need to be able to read through all directories in a given path and list all of the files. I'm using the following code and it works for the top level but not sub-directories. For example, if there is this structure
If will enter into dirA and display fileA. It will also show that it is going into the sub-directory dirB but fileB is never listed. Would someone please point out what I'm missing or let me know if there is a better way to do this?
function GetAllFiles(&$files, $locn)
$dirs = glob($locn . '/*', GLOB_ONLYDIR);