$path = "/home/allstate/public_html/client"; // <-- Path to the location of files function getList($path) { $dh=opendir($path); while($file=readdir($dh)) { $currFile = "$path/$file"; if (is_dir($currFile)) { if ($file !='.' && $file !='..') { # its a dir, recurse. getList($path.'/'.$file); $dirArray[$i] = "Client: $path/$file
\n"; $i++; } else { # its a file. $listArray[$j] = "-- $path/$file
\n"; $j++; } } } }