|
<?php
header("Content-type: text/json; charset=utf-8");
$qq=$_GET["qq"];
$url="http://yundong.qq.com/center/guest?_wv=2172899&asyncMode=1&uin=".$qq;
//获取
$UserAgent = 'Mozilla/5.0 (Linux; Android 5.0; SM-N9100 Build/LRX21V) > AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 > Chrome/37.0.0.0 Mobile Safari/537.36 V1_AND_SQ_5.3.1_196_YYB_D > QQ/5.3.1.2335 NetType/WIFI';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_ENCODING, '');
curl_setopt($curl, CURLOPT_USERAGENT, $UserAgent);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_COOKIE,'这里是COOKIE');
$data = curl_exec($curl);
curl_close($curl);
preg_match_all('/<span class="country">(.*?)<\/span>/' , $data , $country);
preg_match_all('/<span class="number">(.*?)<\/span>/' , $data , $age);
print_r ($country[1][0]);
复制代码
cookie怎么找我就不说了
|
|