function getURLToData($url){ $HTTP_Server = $url; $ch = curl_init(); curl_setopt ($ch,CURLOPT_URL,$HTTP_Server); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,30); curl_setopt($ch,CURLOPT_USERAGENT,"Mozilla/5.0 (Linux; U; Android 4.1.1; zh-cn; MI 2S Build/JRO03L) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30 XiaoMi/MiuiBrowser/1.0"); $res = curl_exec($ch); curl_close ($ch); return $res; } echo getURLToData('http://info.3g.qq.com/');