![]() |
Available news archives:
comp.lang.tcl
-
comp.lang.python
-
comp.security.firewalls
-
sci.crypt -
comp.lang.php -
comp.lang.javascript
|
|
comp.lang.php archiveRe: Getting the filenames from a folder
From: Chung Leong <chernyshevsky@hotmail.com>
Date: Mon Oct 31 2005 - 06:14:16 CET
juglesh wrote:
Yes, if you pass the GLOB_BRACE flag.
Example:
$images = glob("*.{jpeg,jpg,gif,png}", GLOB_BRACE);
You can also character class matching with glob():
$images = glob("[ab]*.gif"); // gif files starting with letter a or b
And wildcards work for sub-folder as well:
$images = glob("*/*.gif"); // gif files in all sub-folders
A real time-saver. One downside though is that the function is broken
|