- image_type_to_mime_type: documentation ( source)
<?php
// if file is a GIF line below should return IMAGETYPE_GIF
$image_type = exif_imagetype('image.gif');
if ($image_type == IMAGETYPE_GIF) {
$mime = image_type_to_mime_type(); // will produce "image/gif" as String.
echo 'The picture is a gif, with a mime type of ' . $mime;
}