glob to take array as an arg
| From: | Kevin Waterson | Date: | Tue, 30 Aug 2005 13:54:53 +0000 |
| Subject: | glob to take array as an arg | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-18565@lists.php.net to get a copy of this message | ||
Currently glob takes a string such as
array glob ( string pattern [, int flags] )
I would like to make this
array glob ( array patterns [, int flags] )
This would tidy up much code where a series of OR's are used to match
different patterns.
$arr = array('jpg', 'gif', 'tif', 'pdf', 'bmp',
'raw');
foreach(glob($arr as $file)){ echo $file; }
This would be better handled interally and the sequential search should
be faster handled internally.
Kevin
--
"Democracy is two wolves and a lamb voting on what to have for lunch.
Liberty is a well-armed lamb contesting the vote."