I need something to read all files in a directory and all files in child directories and any directories below this. Could someone provide a snippet for me. Thanks
function displayDir($mainFolder) { $main = glob("$mainFolder/*"); foreach($main as $folDir) { if(is_dir($folDir) { echo "Folder: $folDir "; displayDir($folDir); } else { echo "File: $folDir "; } } PHP: Untested. Peace,
Please first of all study recursion. Then you can understand the code. If you need more help you are requested to send me PM so that i may send you a script that will work in all situations keeping it in wamp server. Regards Articles Directories