note 23535 deleted from function.readdir by tularis

From: Date: Sun, 13 May 2007 19:07:43 +0000
Subject: note 23535 deleted from function.readdir by tularis
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-126563@lists.php.net to get a copy of this message
Note Submitter: mb at michaelborchers dot net ---- I tried to find a script that would put all files of one directory($img_path) into an array while excluding any subdirectory, not only ".", ".." or "xyz". Chriss found the solution some threads above. The following way the slashes are used work for both- LINUX and WIN: $handle = opendir("$img_path"); while (false !== ($file = readdir($handle))) { if(is_file($img_path."//".$file)) { $filelist[] = $file; $anz_files = count($filelist); } }

« previous php.notes (#126563) next »