从网上学来的处理图片的方法,检测修改后缀名伪造的图片:
//检测伪造
public function checkFlag() {
$this->flag=@getimagesize($this->fileInfo['tmp_name']);
if ($this->flag) {
return true;
}else {
$this->error="请上传合法文件";
return false;
}
}
想请教下,有没有类似getimagesize的方法检测音频和视频的,MP3,MP4。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
读取前8个字节就可以判断了。