php Call to undefined function exif_imagetype()解决方法
|
今天我通过以下php代码获取图片文件的Mime-Type: if(!empty($_FILES['uploadfile']['name']) && $_FILES['uploadfile']['error'] == 0){ $file = $_FILES['uploadfile']['tmp_name']; $file_type = image_type_to_mime_type(exif_imagetype($file)); switch($file_type){ // Codes Here /* http://www.manongjc.com/article/1416.html */ } } 运行代码时,抛出错误Call to undefined function exif_imagetype()。 原因是我们没有在php.ini中开启扩展,具体做法如下: 在php.ini中搜索extension=php_mbstring.dll,然后将前面的分号去掉,即: extension=php_mbstring.dll extension=php_exif.dll (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
