Need help with PHP!
I have a page that displays images from a directory passed through GET. I use this code to find out if the requested directory has images:
$eventcode = trim($_GET['event'])
(snip)
$content = glob(strtolower($eventcode) . '/*.{jpg, JPG, jpeg, JPEG, png, PNG}', GLOB_BRACE);
However, I just found out that the glob instruction above returns false when all images have uppercase extension. Am I overlooking something?
Any insight will be greatly appreciated.
$dir = strtolower($eventcode) . '/*';
foreach (glob($dir) as $file) { }
if that still doesn't work try another way.
Edit:
After taking a look at the link you posted, I went for a different approach. The advantage is that I get the same kind of array out of this piece of code, and I don't need to alter the rest of the code below it.
[i]$filetypes = array('jpg','jpeg','png'); //Possible image extensions
$content = array(''); //1-empty-element array, so it's accepted as an array
if($handle = opendir($eventcode))
{ }else
{ }[/i]
Longer. Way longer. But appears to work well.
Edit: Pretend the TWHL engine displays the indentations too.