See, this is why I never get things done. You guys get me thinking about things, playing with these scripts, hours go by, I completely lose track of time.
But I digress.
Anyway, played with it for a while, had tons of trouble with accuratly recursing though the directories, but got this to work for me. Someone else can prolly do it better, but oh well. I like figuring things out.
function direcho($path,$array) {
$dir = array();
$handle = opendir($path);
while($file = readdir($handle)) {
if($file != "." && $file != "..") {
if(!is_dir($file)) {
$array[] = $file;
}
else {
$dir[] = $path.$file."/";
}
}
}
closedir($handle);
foreach($dir as $d) {
$arr = array();
$new = direcho($d,$arr);
$array = array_merge($array,$new);
}
return $array;
}
$files = direcho("/path/to/your/dir/",array());
echo "<pre>";
print_r($files);
echo "</pre>";
?>