note 28174 added to function.readdir

From: Date: Sat, 04 Jan 2003 21:34:01 +0000
Subject: note 28174 added to function.readdir
Groups: php.notes 
Request: Send a blank email to php-notes+get-41668@lists.php.net to get a copy of this message
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 -- http://www.php.net/manual/en/function.readdir.php http://master.php.net/manage/user-notes.php?action=edit+28174 http://master.php.net/manage/user-notes.php?action=delete+28174 http://master.php.net/manage/user-notes.php?action=reject+28174

« previous php.notes (#41668) next »