note 114569 added to function.image-type-to-mime-type
| From: | slegersjohn at gmail dot com | Date: | Thu, 06 Mar 2014 16:39:08 +0000 |
| Subject: | note 114569 added to function.image-type-to-mime-type | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-198821@lists.php.net to get a copy of this message | ||
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.
----
Server IP: 194.50.97.14
Probable Submitter: 94.225.162.38
----
Manual Page -- http://php.net/manual/en/function.image-type-to-mime-type.php
Edit -- https://master.php.net/note/edit/114569
Del: integrated -- https://master.php.net/note/delete/114569/integrated
Del: useless -- https://master.php.net/note/delete/114569/useless
Del: bad code -- https://master.php.net/note/delete/114569/bad+code
Del: spam -- https://master.php.net/note/delete/114569/spam
Del: non-english -- https://master.php.net/note/delete/114569/non-english
Del: in docs -- https://master.php.net/note/delete/114569/in+docs
Del: other reasons-- https://master.php.net/note/delete/114569
Reject -- https://master.php.net/note/reject/114569
Search -- https://master.php.net/manage/user-notes.php