GD and Image 函数
PHP Manual

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 类型。

Example #1 image_type_to_mime_type (file)

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

返回值如下:

返回值常量
图像类型(imagetype 返回值
Free Web Hosting