Right now, this is what I have and I think it works, but not sure if it's most efficient way:
if ($handle1 = @opendir($basedir)) {
$dir0 = getcwd();
while (false !== ($file1 = readdir($handle1))) {
//ignore files that start with periods (hidden files and parent directories)
if (substr($file1,0,1) != "." && substr($file1,0,2) != "..") {
if (is_dir($file1)) {
chdir($file1);
$dir1 = getcwd();
if ($handle2 = @opendir($dir1)) {
while (false !== ($file2 = readdir($handle2))) {
if (substr($file2,0,1) != "." && substr($file2,0,2) != "..") {
if (is_dir($file2)) {
chdir($file2);
$dir2 = getcwd();
// and so on as many levels as needed
} elseif (ereg("\.htm",$file2)) { echo "$file2<br>"; } } } //end while closedir($handle2); chdir($dir0); } //end opendir } elseif (ereg("\.htm",$file1)) { echo "$file1<br>"; } } } closedir($handle1); // output the results }
Thanks for any assistance.
Dave
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php