>  기사  >  백엔드 개발  >  josn转数组有关问题

josn转数组有关问题

WBOY
WBOY원래의
2016-06-13 12:01:211049검색

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);

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.