note 64613 added to function.readdir

From: Date: Wed, 19 Apr 2006 08:39:59 +0000
Subject: note 64613 added to function.readdir
Groups: php.notes 
Request: Send a blank email to php-notes+get-108509@lists.php.net to get a copy of this message
Here is my recursive read dir function, what read dir by mask. [php] function ls($dir, $mask /*.php$|.txt$*/) { static $i = 0; $files = Array(); $d = opendir($dir); while ($file = readdir($d)) { if ($file == '.' || $file == '..' || eregi($mask, $file) ) continue; if (is_dir($dir.'/'.$file)) { $files += ls($dir.'/'.$file, $mask); continue; } $files[$i++] = $dir.'/'.$file; } return $files; } $f = ls('E:/www/mymoney/lsdu', ".php$" /*no spaces*/); [/php] ---- Server IP: 195.114.128.28 Probable Submitter: 85.202.168.182 ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/function.readdir.php Edit -- http://master.php.net/note/edit/64613 Del: integrated -- http://master.php.net/note/delete/64613/integrated Del: useless -- http://master.php.net/note/delete/64613/useless Del: bad code -- http://master.php.net/note/delete/64613/bad+code Del: spam -- http://master.php.net/note/delete/64613/spam Del: non-english -- http://master.php.net/note/delete/64613/non-english Del: in docs -- http://master.php.net/note/delete/64613/in+docs Del: other reasons-- http://master.php.net/note/delete/64613 Reject -- http://master.php.net/note/reject/64613 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#108509) next »