note 36778 deleted from function.scandir by didou
| From: | didou@php.net | Date: | Wed, 22 Oct 2003 07:52:49 +0000 |
| Subject: | note 36778 deleted from function.scandir by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-59099@lists.php.net to get a copy of this message | ||
Note Submitter: derek@slashviewREMOVE-THIS.com
----
The previous gentleman's code states:
if (ereg("$ext", $filename, $regs))
I believe this doesn't quite catch the required files. For example, if you want to get all gif
files (ie $ext="gif"), the above code will get a file called "gif.txt". My
suggestion is this:
if (preg_match("/" . $ext . "$/",$filename))