duan0504
2014-04-10 00:39
浏览 56
已采纳

如何在php中显示json解码数组?

$appUrl = "https://itunes.apple.com/us/rss/topfreeapplications/limit=400/genre=6014/json";

$appStore = new APPSTORE();
$json_appdata = $appStore->downloadApps($appUrl);

$appdata_array = json_decode($json_appdata, true);
//print_r($appdata_array);

foreach ($appdata_array["entry"] as $row) {
    print_r($row["im:name"]);
}

And then I got the following errors:

Notice: Undefined index: entry on line 13 which is in foreach.

Warning: Invalid argument supplied for foreach() on line 13

My question is: How do I do it so that I can display all the [im:name] elements? Thanks in advance!

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题