note 102314 added to function.image-type-to-mime-type
| From: | hm2katphpdotnet at osu1 dot php dot net | Date: | Tue, 08 Feb 2011 13:57:19 +0000 |
| Subject: | note 102314 added to function.image-type-to-mime-type | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-176774@lists.php.net to get a copy of this message | ||
In reply to benshelock, consider this:
<?php
$path='http://www.hpi.co.uk/images/test/';
$file='15635_0_0.9955380731532122_ORIG.jpg';
$size = getimagesize($path.$file);
echo $size['mime']; //returns image/x-ms-bmp
echo $size[2]; //returns 6
?>
It's probably best to always handle it using the numerical value rather than the interpreted
mime type.
----
Server IP: 69.147.83.197
Probable Submitter: 82.152.138.225
----
Manual Page -- http://www.php.net/manual/en/function.image-type-to-mime-type.php
Edit -- https://master.php.net/note/edit/102314
Del: integrated -- https://master.php.net/note/delete/102314/integrated
Del: useless -- https://master.php.net/note/delete/102314/useless
Del: bad code -- https://master.php.net/note/delete/102314/bad+code
Del: spam -- https://master.php.net/note/delete/102314/spam
Del: non-english -- https://master.php.net/note/delete/102314/non-english
Del: in docs -- https://master.php.net/note/delete/102314/in+docs
Del: other reasons-- https://master.php.net/note/delete/102314
Reject -- https://master.php.net/note/reject/102314
Search -- https://master.php.net/manage/user-notes.php