note 41188 added to function.image-type-to-mime-type
| From: | theprofessoratgmxdotcom at rn2 dot php dot net | Date: | Fri, 02 Apr 2004 07:31:55 +0000 |
| Subject: | note 41188 added to function.image-type-to-mime-type | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-67501@lists.php.net to get a copy of this message | ||
if you need this function in a php version < 4.3 use this function:
<?php
function image_type_to_mime_type($imagetype) {
static $image_type_to_mime_type = array(
1 => 'image/gif', // IMAGETYPE_GIF
2 => 'image/jpeg', // IMAGETYPE_JPEG
3 => 'image/png', // IMAGETYPE_PNG
4 => 'application/x-shockwave-flash', // IMAGETYPE_SWF
5 => 'image/psd', // IMAGETYPE_PSD
6 => 'image/bmp', // IMAGETYPE_BMP
7 => 'image/tiff', // IMAGETYPE_TIFF_II (intel byte order)
8 => 'image/tiff', // IMAGETYPE_TIFF_MM (motorola byte order)
9 => 'application/octet-stream', // IMAGETYPE_JPC
10 => 'image/jp2', // IMAGETYPE_JP2
11 => 'application/octet-stream', // IMAGETYPE_JPX
12 => 'application/octet-stream', // IMAGETYPE_JB2
13 => 'application/x-shockwave-flash', // IMAGETYPE_SWC
14 => 'image/iff', // IMAGETYPE_IFF
15 => 'image/vnd.wap.wbmp', // IMAGETYPE_WBMP
16 => 'image/xbm'); // IMAGETYPE_XBM
return (isset($image_type_to_mime_type[$imagetype]) ? $image_type_to_mime_type[$imagetype] :
false);
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.image-type-to-mime-type.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+41188
Delete -- http://master.php.net/manage/user-notes.php?action=delete+41188&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+41188&report=yes
Search -- http://master.php.net/manage/user-notes.php