$url = 'https://www.baidu.com';
// $url = 'https://www.baidu.com/abc/aaa/cbd';
$status_code = get_headers($url);
if(strpos($status_code[0],'404') !== false){
echo '404<br>';
}else{
echo 'success</br>';
}
var_dump($status_code);die;
$url = 'https://www.baidu.com';
// $url = 'https://www.baidu.com/abc/aaa/cbd';
$status_code = get_headers($url);
if(strpos($status_code[0],'404') !== false){
echo '404<br>';
}else{
echo 'success</br>';
}
var_dump($status_code);die;