我的代码:
$json_data = file_get_contents($json_url,0,null,null);
$json_output = json_decode($json_data);
var_dump($json_output);
这是 var_dump 在一大行中吐出的内容,根本没有格式化:
object(stdClass)#1 (1) { ["timetableresult"]=> object(stdClass)#2 (1) { ["ttitem"]=> array(17) { [0]=> object(stdClass)#3 (1) { ["segment"]=> array(8) { [0]=> object(stdClass)#4 (3) { ["segmentid"]=> object(stdClass)#5 (2) { ["mot"]=> object(stdClass)#6 (3) { ["@displaytype"]=> string(1) "G" ["@type"]=> string(1) "G" ["#text"]=> string(5) "GÃ¥ng" } ["distance"]=> int(1008) } ["departure"]=> object(stdClass)#7 (2)... etc.etc.
我究竟做错了什么?