Re: [PHP] Glob

2007-11-29 Thread Tom Chubb
On 29/11/2007, Robert Cummings <[EMAIL PROTECTED]> wrote: > On Thu, 2007-11-29 at 17:19 +, Tom Chubb wrote: > > 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,}"

Re: [PHP] Glob

2007-11-29 Thread Robert Cummings
On Thu, 2007-11-29 at 17:19 +, Tom Chubb wrote: > 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 extensio

[PHP] Glob

2007-11-29 Thread Tom Chubb
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 thi

Re: [PHP] glob(path_pattern, GLOB_ONLYDIR)

2007-03-19 Thread Richard Lynch
On Sun, March 18, 2007 4:30 am, Jim Lucas wrote: > Al wrote: >> print_r(glob('../*', GLOB_ONLYDIR)); > well, double check your php version, because this should be built in > whit the version that you are running. > >> >> And I get: "Warning: glob() expects parameter 2 to be long, string >> given >

Re: [PHP] glob(path_pattern, GLOB_ONLYDIR)

2007-03-18 Thread Al
It doesn't on my Linux system glob("../path/*"); shows files and dirs; foo.ext and dirs Exactly the same as glob("../path/*.*"); I thought using just plain "*" would ignore files; but, it doesn't. Jochem Maas wrote: Al wrote: I thought the "." had meaning since the manual user notes used

Re: [PHP] glob(path_pattern, GLOB_ONLYDIR)

2007-03-18 Thread Al
That nailed my problem. GLOB_ONLYDIR is a defined constant. It echos as 8192. I inadvertently treated it as a string with quotes, which I didn't include in my original post. I had forgotten that most function flags are simply constants which can be tested for and printed, etc. Many thanks.

Re: [PHP] glob(path_pattern, GLOB_ONLYDIR)

2007-03-18 Thread Jochem Maas
Al wrote: > I thought the "." had meaning since the manual user notes used it it means a literal dot, many people assume that glob expressions use the same syntax as regular expressions but this is not the case. > > Definitely, my php is version 4.4.4; it's on a virtual host. > > I found the gl

Re: [PHP] glob(path_pattern, GLOB_ONLYDIR)

2007-03-18 Thread Jim Lucas
Al wrote: I thought the "." had meaning since the manual user notes used it Definitely, my php is version 4.4.4; it's on a virtual host. I found the glob file for the GNU C Library and GLOB_ONLYDIR doesn't seem to be defined correctly, the file appears to rather old. echo GLOB_ONLYDIR; doe

Re: [PHP] glob(path_pattern, GLOB_ONLYDIR)

2007-03-18 Thread Al
I thought the "." had meaning since the manual user notes used it Definitely, my php is version 4.4.4; it's on a virtual host. I found the glob file for the GNU C Library and GLOB_ONLYDIR doesn't seem to be defined correctly, the file appears to rather old. I used the numerical value "8196" a

Re: [PHP] glob(path_pattern, GLOB_ONLYDIR)

2007-03-18 Thread Jim Lucas
Al wrote: I can't use flag "GLOB_ONLYDIR" to work on a Linux, php4.4.4. I only want the dirs. This works; sort of: print_r(glob('../*',)); //It lists all the files AND directories. Yet it seems to ignore the lack of ".*" and finds xxx.yyy. That's OK, I can delete the files remember this is

[PHP] glob(path_pattern, GLOB_ONLYDIR)

2007-03-17 Thread Al
I can't use flag "GLOB_ONLYDIR" to work on a Linux, php4.4.4. I only want the dirs. This works; sort of: print_r(glob('../*',)); //It lists all the files AND directories. Yet it seems to ignore the lack of ".*" and finds xxx.yyy. That's OK, I can delete the files This fails: print_r(glob('.

Re: [PHP] GLOB sort order

2005-11-22 Thread Jochem Maas
Georgi Ivanov wrote: On Tuesday 22 November 2005 11:41, Mark Lucas wrote: Can anyone help me please? I'm not an advanced PHP user! I'm looing for a way to sort the array returned by the GLOB function. I would like to be able to sort the result by filemtime. Any good ideas? I think you can

Re: [PHP] GLOB sort order

2005-11-22 Thread Georgi Ivanov
On Tuesday 22 November 2005 11:41, Mark Lucas wrote: > Can anyone help me please? I'm not an advanced PHP user! > > I'm looing for a way to sort the array returned by the GLOB function. I > would like to be able to sort the result by filemtime. > > Any good ideas? I think you can walk the array re

[PHP] GLOB sort order

2005-11-22 Thread Mark Lucas
Can anyone help me please? I'm not an advanced PHP user! I'm looing for a way to sort the array returned by the GLOB function. I would like to be able to sort the result by filemtime. Any good ideas? Thanks, Mark

[PHP] glob behavior on OSX

2005-09-13 Thread Luis MagaƱa
Hi, am using glob in linux to match files like this with no problems: glob("../dbimages/banners/{*.[jJ][pP][gG],*.[gG][iI][fF]}",GLOB_BRACE); that matches gif o jpg case insensitive, now this works on linux with no problems, but it does not in OSX. //This works nice in OSX glob("../dbimages/bann