How to get the HTML code for a remote Web page, file_get_contents does not work
Remote Address:http://rate.taobao.com/member_rate.htm?content=1&result=0&from=rate&user_id=281461646& Identity=1&rater=0&direction=0&timeline=-7&callback=shop_rate_list
Can be obtained through the browser, but through the file_get_contents this function is empty, what other ways? The resulting data looks a bit like JSON, but instead of converting it to an array with Json_decode, the method of converting the resulting data into arrays
------Solution--------------------
It's a bit different from the JSON json of JS and PHP, and it gets with jquery:
JScript code
$.getjson ("Http://rate.taobao.com/member_ Rate.htm?content=1&result=0&from=rate&user_id=281461646&identity=1&rater=0&direction=0 &timeline=-7&callback=shop_rate_list ", function (JSON) {alert (" JSON Data: "+ JSON);});
------Solution--------------------
PHP code
$con = File_ Get_contents ($url); $con = Preg_replace ('/shop_rate_list\ ((. *) \)/s ', ' $ ', $con); Print_r (Json_decode (iconv (' GBK ', ' utf-8 ', $con), true));