判断远程图片是否存在
function img_exists($url) {
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_NOBODY, true);// 不取回数据
curl_exec($curl);// 发送请求
$httpCode = curl_getinfo($curl,CURLINFO_HTTP_CODE); //获取返回码
if($httpCode==404){
return false;
}
}