Products
GG网络技术分享 2025-03-18 16:17 0
//判断远程资源是否存在
function resource_exists($url){
$res =get_headers( $url );
$statusCode = substr ( $res[0], 9, 3);
if ( $statusCode == 200 || $statusCode == 304){
// 存在
return true;
} else {
// 不存在
return false;
}
}Demand feedback