I have image upload php class. This process uploaded Images(.png,jpeg,.gif).
I am using this function to find image type
function getImageType($image_name){
return end(explode('.',$mage_name));
}
if someone upload any file with fake extension . error will happen. How can i Check type of image without
checking extension?
You can use getimagesize to get the mime type, and switch on the type to create generate extension.
In code this could look like something like this: