Home  >  Article  >  Backend Development  >  josn转数组有关问题

josn转数组有关问题

WBOY
WBOYOriginal
2016-06-13 12:01:211013browse

josn转数组问题
http://rate.tmall.com/list_detail_rate.htm?itemId=37206718528  打开这个网址就是淘宝评论的一个JOSN数据,本人用json_decode转换没效果,请问这是什么原因呢?
详细代码如下

<br />$html= file_get_contents("http://rate.tmall.com/list_detail_rate.htm?itemId=37206718528&spuId=248125721&sellerId=1975404340&order=1&currentPage=1&append=0&content=1&tagId=&posi=&picture=&ua=117tpOWUuXBidH1MRUwx%2BKHgvfSh%2BLXooZRhg%3D%3D%7CtaBkcTQxdEEUgeTB5OH0YbY%3D%7CtJFV4sagOBFJIdlQdLCUoaSARGAXj2cv166Xs2Sz%7Cs6aDR2N2MzZzRhOG48bj5vNmw8YiB4L3YmdyB5Ln8veC9%2FKHEjbh%7Csqcy9kFkoPVgpLGUUHRB1WD44BisGIw1rcXhNuE%3D%7CsYRA9%2BLH8jYz9%2BLn4pdTZvOmwwcSFzJ3s8ajJuL38teSViMWk0ST%7CsPUxhqKGQhdiB8P204ZC19KX0gXS%7Cv%2Fo%2Bia2JTRiNmFxJTHl8uI2oLVgdWI");<br />$html = iconv("gbk", "utf-8//IGNORE",$html); <br />$s=json_decode($html,true);<br />print_r ($s);<br />

------解决方案--------------------
$html= file_get_contents("http://rate.tmall.com/list_detail_rate.htm?itemId=37206718528&spuId=248125721&sellerId=1975404340&order=1¤tPage=1&append=0&content=1&tagId=&posi=&picture=&ua=117tpOWUuXBidH1MRUwx%2BKHgvfSh%2BLXooZRhg%3D%3D%7CtaBkcTQxdEEUgeTB5OH0YbY%3D%7CtJFV4sagOBFJIdlQdLCUoaSARGAXj2cv166Xs2Sz%7Cs6aDR2N2MzZzRhOG48bj5vNmw8YiB4L3YmdyB5Ln8veC9%2FKHEjbh%7Csqcy9kFkoPVgpLGUUHRB1WD44BisGIw1rcXhNuE%3D%7CsYRA9%2BLH8jYz9%2BLn4pdTZvOmwwcSFzJ3s8ajJuL38teSViMWk0ST%7CsPUxhqKGQhdiB8P204ZC19KX0gXS%7Cv%2Fo%2Bia2JTRiNmFxJTHl8uI2oLVgdWI");<br />$html = '{' . $html . '}'; <br />$html = iconv("gbk", "utf-8//IGNORE",$html);<br />$s=json_decode($html,true);<br />print_r ($s);

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn