1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- function curl_post($url, $param){
- $curlPost = $param;
- $header = array(
- 'Cookie: jiathis_rdcd=d7186b817fe60073a5eef118b1b65161; addo=ture; jiathis_rdcdcc=fa5375df32bda8862801ea43b6358683; PHPSESSID=n7e3q2lqi9cltct88f3nl1dq54; Hm_lvt_5a903fe4f343bef5b71db5664648022b=1539155183,1539156573,1539315083; Hm_lpvt_5a903fe4f343bef5b71db5664648022b=1539315083' ,
- 'Origin: https://www.taodaxiang.com' ,
- 'Accept-Encoding: gzip, deflate, br' ,
- 'Accept-Language: zh-CN,zh;q=0.9' ,
- 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36' ,
- 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' ,
- 'Accept: application/json, text/javascript, */*; q=0.01' ,
- 'Referer: https://www.taodaxiang.com/score/index/init' ,
- 'X-Requested-With: XMLHttpRequest' ,'Connection: keep-alive'
- );
- $ch = curl_init();//初始化curl
- curl_setopt($ch, CURLOPT_URL,$url);
- curl_setopt($ch, CURLOPT_HEADER, 0);//
- curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);//要求结果为字符串且输出到屏幕上
- curl_setopt($ch, CURLOPT_POST, 1);//post提交方式
- curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- $data = curl_exec($ch);//运行curl
- curl_close($ch);
- return $data;
- }
- $url = "https://www.taodaxiang.com/score/index/get11015255";
- //$param = 'account=%E5%B0%8F%E7%B1%B3%E6%97%97%E8%88%B0%E5%BA%97&n=0';
- $param = 'account='.urlencode('潮流前线zk').'&n=0';
- //$param = ['account'=>'小米旗舰店','n'=>0];//urlencode($param);
- $res = curl_post($url,$param);
- $res = json_decode($res,true);
- var_dump($param,$res);
|