//判断远程资源是否存在
function resource_exists($url){
$res =get_headers( $url );
$statusCode = substr ( $res[0], 9, 3);
if ( $statusCode == 200 || $statusCode == 304){
// 存在
return true;
} else {
// 不存在
return false;
}
}
相关文章
//判断远程资源是否存在
function resource_exists($url){
$res =get_headers( $url );
$statusCode = substr ( $res[0], 9, 3);
if ( $statusCode == 200 || $statusCode == 304){
// 存在
return true;
} else {
// 不存在
return false;
}
}