On Fri, 5 Sep 2003, FB wrote:

} I need a small script of php selecting all the files in a directory and
} putting the names in an array.
} Also, selecting a specific type might be helpfull like *.TXT


$dir = dir('/your/dir/here');
while ($file = $dir->read()) {
  if (preg_match('/\.TXT$/i', $file)) {
     $matches[] = $file;

Your files will be in the $matches array.


Vince LaMonica               UC Irvine,  School  of  Social Ecology
 W3 Developer       <*>      116 Social Ecology I, Irvine, CA 92697
 [EMAIL PROTECTED]                  http://www.seweb.uci.edu/techsupport

 Tower: "Delta Zulu Romeo, turn right now and report your heading."
 Pilot: "Wilco. 341, 342, 343, 344, 345..."

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to