【发布时间】:2014-11-13 03:41:29
【问题描述】:
我想通过 URL 使用 PHP 获取文件类型(例如图像/gif)。我试过了
<?php
$image_path="http://fc04.deviantart.net/fs71/f/2010/227/4/6/PNG_Test_by_Destron23.png";
exif_imagetype($image_path);
?>
上面的代码给了我一个空白页,下面的代码返回“3”:
<?php
$image_path="http://fc04.deviantart.net/fs71/f/2010/227/4/6/PNG_Test_by_Destron23.png";
echo exif_imagetype($image_path);
?>
我哪里错了? 已解决:使用 Fileinfo 获取内容类型
【问题讨论】: