方法一 $header_info=get_headers('//www.jb51.net/'); echo $header_info[0]; //耗时 0.67~0.78 方法二 $ch = curl_init ( '//www.jb51.net/' ); curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_exec ( $ch ); $httpcode = curl_getinfo ( $ch, CURLINFO_HTTP_CODE );…