I am using below code successfully to find the first image from a folder and display it. The problem I have is that the client has uploaded images with a mixture of uppercase and lowercase .jpg extensions on the images. Can i adjust my code to allow for both uppercase and lowercase .jpg extensions, as it only likes lower case?
$search_dir = "properties/".$row['Reference_No'];
$images = glob("$search_dir/*.jpg");
sort($images);
// Image selection and display:
//display first image
if (count($images) > 0) { // make sure at least one image exists
$img = $images[0]; // first image
echo "<img src='../../$img' width='320' height='200' border='0' /> ";
} else {
// possibly display a placeholder image?
}