see if this does what you are looking for:
$start = "/www/htdocs";
function check_dir($start) {
$dir = opendir($start);
while ($file = readdir($dir)) {
if ($file == "." || $file == "..") continue;
if (is_dir($file)) {
print "Contents of Directory $file...<br />";
check_dir($start . "/" . $file);
} else {
print $file . '<br />';
}
}
The only problem with my code is that it lists the files in create order so you get some files in the start directory, then it hits another directory and lists its files, then it goes back to the starting directory and lists a few more file from there. If anybody knows a way to correct that behavior, it would be greatly appreciated.