PHP.nl

image_type_to_mime_type

image_type_to_mime_type

Get Mime-Type for image-type returned by getimagesize, exif_read_data, exif_thumbnail, exif_imagetype

string **image_type_to_mime_type** int $image_type

The function will determine the Mime-Type for an IMAGETYPE constant. image_type_to_mime_type

image_type One of the constants. IMAGETYPE_*

The returned values are as follows

Voorbeeld: example

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

getimagesize``exif_imagetype``exif_read_data``exif_thumbnail