只要用于只需要发起请求,不需要接收响应值的,因为接收响应值浪费大量时间
$url = 'http://tencentlog.com/stat/report.php';
$post_data = array();
$this->http_request($url,'POST',$post_data);
//发起http请求之后立即关闭访问信息
function http_get_host_ip($hostname){
if($hostname == 'tencentlog.com'){
return '183.61.46.160';
}else if($hostname == 'union.tencentlog.com'){
return '140.206.160.173';
}
return gethostbyname($hostname);
}
/**
* http 请求 - mayer
*
* @param String $url
* @param String $type GET or POST
* @param Array $post_data
* @return false or String
*/
function http_request($url, $type = "GET", $post_data = NULL)
{
$type = strt