撒的阿坎努斯 发表于 2017-4-5 07:54:15

php 判断是否为PNG格式的图片 

function isPng($pngPath)
{
$size = getimagesize ($pngPath);
$file_extension = strtolower(substr(strrchr($pngPath,'.'),1));
if('image/png' != $size['mime'] || $file_extension != 'png')
{
return FALSE;
}
else {
return TRUE;
}
}
页: [1]
查看完整版本: php 判断是否为PNG格式的图片