note 82529 modified in function.readdir by danbrown
| From: | danbrown@php.net | Date: | Thu, 25 Feb 2010 20:33:05 +0000 |
| Subject: | note 82529 modified in function.readdir by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-166372@lists.php.net to get a copy of this message | ||
This is a nice quick full dir read - sorry for my bad english ;)
<?php
function ReadDirs($dir,$em){
if ($handle = opendir($dir)) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != ".." && $file !=
"Thumb.db") {
if(is_dir($dir.$file)){
echo $em."» ".$file.'<br>';
ReadDirs($dir.$file."/",$em." ");
}
}
}
closedir($handle);
}
}
?>
--was--
This is a nice quick full dir read - sorry for my bad english ;)
function ReadDirs($dir,$em){
if ($handle = opendir($dir)) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != ".." && $file !=
"Thumb.db") {
if(is_dir($dir.$file)){
echo $em."» ".$file.'<br>';
ReadDirs($dir.$file."/",$em." ");
}
}
}
closedir($handle);
}
}
http://php.net/manual/en/function.readdir.php