$json='{"results":[{"location":{"id":"WW56FQXV5ZHB","name":"徐州","country":"CN","path":"徐州,徐州,江苏,中国","timezone":"Asia/Shanghai","timezone_offset":"+08:00"},"now":{"text":"阴","code":"9","temperature":"20"},"last_update":"2017-04-15T22:15:00+08:00"}]}';
$dejson=json_decode($json,true);
echo $dejson[now][text];//错误
请教下各位大神,要读取这个数组里的 text值, 该怎么输出,蟹蟹~
漂亮男人2017-05-16 13:16:03
echo $dejson['results'][0]['now']['text'];
代码如上,其实你自己
var_dump()
一下$dejson
就知道要怎么选择自己想要的值啦。