<?php
//set_time_limit(0);
function getHttpStatus($url) {
$curl = curl_init();
curl_setopt($curl,CURLOPT_URL,$url);
curl_setopt($curl,CURLOPT_NOBODY,1);
curl_setopt($curl,CURLOPT_RETURNTRANSFER,1);
curl_setopt($curl,CURLOPT_TIMEOUT,5);
curl_exec($curl);
$re = curl_getinfo($curl,CURLINFO_HTTP_CODE);
curl_close($curl);
return $re;
}
$url = 'baidu.com';
echo getHttpStatus($url);
//coda:rand(100,999).'kxw'; if you get it :-)
版权声明:本文为jjmaiz原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。