【发布时间】:2015-05-23 18:05:32
【问题描述】:
这是我的json。
在php中
$json = json_decode($finalAppData, true); // decode the JSON into an associative array
//suppose this is $link = ['appInfo']['items'][0]['screen']['items'][0]['screen']['items'][0];
此代码无效。
echo $json .$link."['screen']['menuHeader']";
产生输出为
Array['appInfo']['items'][0]['screen']['items'][0]['screen']['items'][0]['screen']['menuHeader'].
但我想要如果我简单地使用就可以看到的文本值
echo $json['appInfo']['items'][0]['screen']['items'][0]['screen']['items'][0]['screen']['menuHeader'];
如何使用存储在变量中的索引从php中的json输出数据。
【问题讨论】:
标签: php json codeigniter concatenation codeigniter-2