php高效检测远程图片是否存在
php高效检测远程图片是否存在
function img_exits($url){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_NOBODY, 1); // 不下载
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
if(curl_exec($ch)!==false)
return true;
else
return false;
}
$result = img_exits($img);
var_dump($result);![360浏览器如何禁止切换到兼容模式[本地终极办法]](http://p6.qhimg.com/d/360browser/20131016/UAshili.png)

