Re: [PHP] Glob
- From: tomchubb@xxxxxxxxx ("Tom Chubb")
- Date: Thu, 29 Nov 2007 17:36:13 +0000
On 29/11/2007, Robert Cummings <robert@xxxxxxxxxxxxx> wrote:
On Thu, 2007-11-29 at 17:19 +0000, Tom Chubb wrote:Wll spotted Rob,
Please can someone help me understand the following:
I have 4 images with a .jpg extension in a folder.
The following reads all four:
$files = glob("thumbs/{*.gif,*.jpg,}",GLOB_BRACE);
All good, however, I noticed that if the extension is in capital
letters, eg .JPG it doesn't work. Apparently this is because when
using *. in glob it's case-sensitive (I have RTFM/STFW)
So, I would expect the following to work, but it's reading each image twice!
$files = glob("thumbs/{*.gif,*.jpg,*.jpeg,*,png}",GLOB_BRACE);
What am I missing?
You have *,png when you should have *.png. The * is matching everything.
Cheers,
Rob.
--
...........................................................
SwarmBuy.com - http://www.swarmbuy.com
Leveraging the buying power of the masses!
...........................................................
Thanks,
Tom
.
- References:
- Glob
- From: "Tom Chubb"
- Re: [PHP] Glob
- From: Robert Cummings
- Glob
- Prev by Date: Re: newbie question on escaping strings
- Next by Date: Re: [PHP] dump a class
- Previous by thread: Re: [PHP] Glob
- Next by thread: dump a class
- Index(es):