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