string image_type_to_mime_type (int $imagetype)Parameters:This function takes one parameter $imagetype,which contains the integer value of IMAGETYPE_XXX constants like IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG, etc.Return Values:This function returns a Mime string for the given IMAGETYPE constant.Below is an exhaustive list of all return values.
imagetype Return value IMAGETYPE_GIF image / gif IMAGETYPE_JPEG image / jpeg IMAGETYPE_PNG image / png IMAGETYPE_SWF application / x-shockwave-flash IMAGETYPE_PSD image / psd IMAGETYPE_BMP image / bmp IMAGETYPE_TIFF_II (intel byte order) image / tiff IMAGETYPE_TIFF_MM (motorola byte order) image/tiffIMAGETYPE_JPCapplication/octet-stream IMAGETYPE_JP2 image / jp2 IMAGETYPE_JPX application / octet-stream IMAGETYPE_JB2 application/octet-streamIMAGETYPE_SWCapplication/x-shockwave-flash IMAGETYPE_IFF image / iff IMAGETYPE_WBMP image / vnd.wap.wbmp < / tr> IMAGETYPE_XBM image / xbm IMAGETYPE_ICO image / vnd.microsoft.icon IMAGETYPE_WEBP image / webp
The following programs illustrate the image_type_to_mime_type() function in PHP:Program 1: echo
image_type_to_mime_type (IMAGETYPE_PNG);
?>
Output:image / png
Program 2: echo
image_type_to_mime_type (IMAGETYPE_JPEG);
?>
Output:image / jpeg
Link: https://www.php.net/manual/en/function.image-type-to-mime-type.php
Shop
Latest questions
Wiki