image_type_to_extension

(PHP 5 >= 5.2.0, PHP 7)

image_type_to_extensionȡ��ͼ�����͵��ļ���׺

˵��

image_type_to_extension ( int $imagetype [, bool $include_dot = TRUE ] ) : string

���ݸ����ij��� IMAGETYPE_XXX ���غ�׺����

����

imagetype

IMAGETYPE_XXX ϵ�г���֮һ��

include_dot

�Ƿ��ں�׺��ǰ��һ���㡣Ĭ���� TRUE��

����ֵ

����ָ����ͼ�����ͷ��ض�Ӧ�ĺ�׺����

����

Example #1 image_type_to_extension() ����

<?php
// ����ͼ��ʵ��
$im imagecreatetruecolor(100100);

// ����ͼ��
imagepng($im'./test' image_type_to_extension(IMAGETYPE_PNG));
imagedestroy($im);
?>

ע��

Note:

�˺�������Ҫ GD ͼ��⡣