curl with php return messed up string -
i tried using curl in php fetch xml file, url http://game1-cbt.ma.sdo.com:10001/connect/app/exploration/fairyhistory?cyt=1, returning string messed up. googled , tried curl_setopt($c, curlopt_encoding, '');, still doesn't work. content showed didn't change. here full program
$url = "http://game1-cbt.ma.sdo.com:10001/connect/app/exploration/fairyhistory"; $ua="million/100 (m0; m0xx; 4.2.2) samsung/m0xx/m0:4.2.2/jdq39/i9300xxufme3:user/release-keys"; $cookies = "s=85g158t9j3t4hi6kmcf47rbjh1"; $c = curl_init(); curl_setopt($c,curlopt_url,$url); curl_setopt($c,curlopt_header,0); curl_setopt($c,curlopt_returntransfer,true); curl_setopt($c,curlopt_useragent,$ua); curl_setopt($c, curlopt_encoding, ''); curl_setopt($c,curlopt_cookie,$cookies); $r = curl_exec($c); echo $r;
update:
it works line ua commented. thank all!
ps: ua package captured mobile online game,i'm trying simulate actions of game.
$url = "http://game1-cbt.ma.sdo.com:10001/connect/app/exploration/fairyhistory"; $ua = "million/100 (m0; m0xx; 4.2.2) samsung/m0xx/m0:4.2.2/jdq39/i9300xxufme3:user/release-keys"; $cookies = "s=85g158t9j3t4hi6kmcf47rbjh1"; $c = curl_init(); curl_setopt($c, curlopt_url, $url); curl_setopt($c, curlopt_header, 0); curl_setopt($c, curlopt_returntransfer, true); //curl_setopt($c, curlopt_useragent, $ua); - don't need curl_setopt($c, curlopt_encoding, ''); curl_setopt($c, curlopt_cookie, $cookies); $r = curl_exec($c); echo $r;
Comments
Post a Comment