更新时间:2022-10-28 18:00:33
You can use exif_imagetype()
<?php
$type =exif_imagetype($image);
where $type is a value
From the manual:
When a correct signature is found, the appropriate constant value will be returned otherwise the return value is FALSE. The return value is the same value that getimagesize()
returns in index 2 but exif_imagetype()
is much faster.