FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » How to match image file names under a directory with glob()
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
How to match image file names under a directory with glob() [message #169856] Tue, 28 September 2010 17:24 Go to next message
Daniel Peraza is currently offline  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 Go to previous messageGo to next message
PlastiqueMAN is currently offline  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 Go to previous message
Daniel Peraza is currently offline  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.
>
>
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: ssl and php
Next Topic: global var vs session vs something else maybe?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 05:43:54 GMT 2024

Total time taken to generate the page: 0.02546 seconds