Jump to content

Archived

This topic is now archived and is closed to further replies.

Mutley

Glob function, anyone know it?

Recommended Posts

Simple put:

[code]$thumbnail_files = glob($thumbnail_folder . "/*jpg");
[/code]

I would like it to find "jpg" AND "JPG" not just jpg which it is atm.

Can't seem to get it to work however. If anyone knows how?

Share this post


Link to post
Share on other sites
I dont know glob very well, I have checked the manual, and I cant see any flags which is about case sensative
try ADDING
$thumbnail_files .= glob($thumbnail_folder . "/*JPG");

Share this post


Link to post
Share on other sites
Use glob_brace - direct from the manual - http://ca.php.net/manual/en/function.glob.php

[quote]Here's an example of how to use the GLOB_BRACE flag:

$images = glob("/path/to/images/{*.jpg,*.JPG}", GLOB_BRACE);

It's also worth noting that when using the GLOB_BRACE flag in any version of PHP prior to 4.3.4, PHP will crash if no matches are found.[/quote]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.