note 28174 deleted from function.readdir by tularis
| From: | tularis@php.net | Date: | Sun, 13 May 2007 19:07:20 +0000 |
| Subject: | note 28174 deleted from function.readdir by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-126558@lists.php.net to get a copy of this message | ||
Note Submitter: php dot net at phor dot net
----
This is equivilent to (and more modular than): $file_list=explode("\n",
find $path
-type f)
function walk_dir($path)
{
if ($dir = opendir($path)) {
while (false !== ($file = readdir($dir)))
{
if ($file[0]==".") continue;
if (is_dir($path."/".$file))
$retval = array_merge($retval,walk_dir($path."/".$file));
else if (is_file($path."/".$file))
$retval[]=$path."/".$file;
}
closedir($dir);
}
return $retval;
}
-- Full Decent