If you are working with Images only and you need mime type (e.g. for headers), then this is a fast and reliable technique: <?php$file = 'path/to/image.jpg';$image_mime = image_type_to_mime_type(exif_imagetype($file));?>It will output true image mime type even if you rename your image file.