超越PHP PHP动态 | 经典文章 | CLASS | 相关下载 | 常见问题 | FORUM | WIKI | 在线手册
Site search:    
<image_type_to_extensionimage2wbmp>
Last updated: Fri, 22 Jun 2007

image_type_to_mime_type

(PHP 4 >= 4.3.0, PHP 5)

image_type_to_mime_type --  取得 getimagesize,exif_read_data,exif_thumbnail,exif_imagetype 所返回的图像类型的 MIME 类型

说明

string image_type_to_mime_type ( int imagetype)

image_type_to_mime_type() 函数可以判断一个 IMAGETYPE 常量的 MIME 类型。

例子 1. image_type_to_mime_type (file)

<?php
header
("Content-type: ".image_type_to_mime_type (IMAGETYPE_PNG));
?>

返回值如下:

表格 1. 返回值常量

图像类型(imagetype返回值
IMAGETYPE_GIFimage/gif
IMAGETYPE_JPEGimage/jpeg
IMAGETYPE_PNGimage/png
IMAGETYPE_SWFapplication/x-shockwave-flash
IMAGETYPE_PSDimage/psd
IMAGETYPE_BMPimage/bmp
IMAGETYPE_TIFF_II (intel byte order)image/tiff
IMAGETYPE_TIFF_MM (motorola byte order) image/tiff
IMAGETYPE_JPCapplication/octet-stream
IMAGETYPE_JP2image/jp2
IMAGETYPE_JPXapplication/octet-stream
IMAGETYPE_JB2application/octet-stream
IMAGETYPE_SWCapplication/x-shockwave-flash
IMAGETYPE_IFFimage/iff
IMAGETYPE_WBMPimage/vnd.wap.wbmp
IMAGETYPE_XBMimage/xbm

注: 本函数不需要 GD 库。

参见 getimagesize()exif_imagetype()exif_read_data()exif_thumbnail()




add a note add a note User Contributed Notes
image_type_to_mime_type
aidan at php dot net
11-Sep-2004 04:04
This functionality is now implemented in the PEAR package PHP_Compat.

More information about using this function without upgrading your version of PHP can be found on the below link:

http://pear.php.net/package/PHP_Compat

<image_type_to_extensionimage2wbmp>
 Last updated: Fri, 22 Jun 2007
view source | feedback | send page | sitemap | aboutus   
Copyright ® 2002-2003 PHPE.NET. All rights reserved
Last updated:2002-11-22