How to match image file names under a directory with glob() [message #169856] |
Tue, 28 September 2010 17:24 |
Daniel Peraza
Messages: 6 Registered: September 2010
Karma: 0
|
Junior Member |
|
|
Hi there! I need to match those file names corresponding to images
with glob() but I can't find a pattern that
matches .jpg, .png, .gif, .bmp files all at the same time. Would
somebody help me please?
I already tried glob("*.jpg *.png *.gif *.bmp") unsuccessfully.
|
|
|
Re: How to match image file names under a directory with glob() [message #169857 is a reply to message #169856] |
Tue, 28 September 2010 18:20 |
PlastiqueMAN
Messages: 5 Registered: September 2010
Karma: 0
|
Junior Member |
|
|
try : glob('*.{jpg,png,gif,bmp}', GLOB_BRACE);
On 2010-09-28 19:24:43 +0200, Daniel Peraza said:
> Hi there! I need to match those file names corresponding to images
> with glob() but I can't find a pattern that
> matches .jpg, .png, .gif, .bmp files all at the same time. Would
> somebody help me please?
>
> I already tried glob("*.jpg *.png *.gif *.bmp") unsuccessfully.
|
|
|
Re: How to match image file names under a directory with glob() [message #169860 is a reply to message #169857] |
Tue, 28 September 2010 19:50 |
Daniel Peraza
Messages: 6 Registered: September 2010
Karma: 0
|
Junior Member |
|
|
That seems to work, thanks!
On Sep 28, 2:20 pm, PlastiqueMAN <non...@noname.com> wrote:
> try : glob('*.{jpg,png,gif,bmp}', GLOB_BRACE);
>
> On 2010-09-28 19:24:43 +0200, Daniel Peraza said:
>
>> Hi there! I need to match those file names corresponding to images
>> with glob() but I can't find a pattern that
>> matches .jpg, .png, .gif, .bmp files all at the same time. Would
>> somebody help me please?
>
>> I already tried glob("*.jpg *.png *.gif *.bmp") unsuccessfully.
>
>
|
|
|