function get_http_code($url) { $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); //设置URL curl_setopt($curl, CURLOPT_HEADER, 1); //获取Header curl_setopt($curl, CURLOPT_NOBODY, true); //Body就不要了吧,我们只是需要Head curl_setopt($curl, CURLOPT_RETURNTRA…