Jan062013
php判断图片格式
作者:黑♂白 发布:2013-01-06 16:14:55 分类: web后端
php中如何判断图片格式,下面给出一种较为简便的方法:
$file= "test.jpg";
$filetype= strtolower(strrchr($file,"."));
$arrtype = array(".jpeg",".bmp",".gif",".jpg");
if(!in_array($filetype,$arrtype))
{
echo '不符合格式';
exit;
}
您还未登录,需要登录后才能发言