I would run the user-defined function file_exists () to check in which case the image extension.
Use this custom function to check the correct case (skip it in lowercase, then use lowercase letters if it returns 1, or use uppercase letters if it returns 2):
function file_exists_case($strUrl)
{
$realPath = str_replace('\\','/',realpath($strUrl));
if(file_exists($strUrl) && $realPath == $strUrl)
{
return 1;
}
elseif(file_exists($realPath))
{
return 2;
}
else
{
return 0;
}
}
You really have to go in and make all the file name extensions lowercase when you get the time.
How could you do this by running glob () through the directories: http://php.net/manual/en/function.glob.php and renaming each file extension to lowercase using strtolower (): http: // php .net / manual / en / function.strtolower.php
source
share