Hi. I am looking for a script that will simply list the file name of every file in a certain directory, and all it's sub directories. Is this possible, and does anyone know how to do it?
foreach (ListFiles('/home/ibbo') as $key=>$file){ echo $file ."<br />"; }
This method useses recursion (it calls itself untill happy basically) to filter all the files in a given dir. If file returns as type dir then we enter it and poll all the files again untill we find no more dir's. We then drop back a dir and move to the next file repeating the process when we find another dir.
If file is not a dir we just append it to our list which we print out later.
Easy for some, confusing for others but likely to be behond most.