0
我想使用PHP的foreach()循环从Reddit JSON API中提取标题和URL。 Here is what the JSON outputs when used in print_r.Reddit API - 从Json使用foreach提取信息()
这里是我到目前为止的代码...
$string_reddit = file_get_contents("http://reddit.com/hot.json");
$json = json_decode($string_reddit, true);
我加入回声($标题);回声“
”;它似乎只是输出.json中的第一个和最后一个条目。 – Harry 2013-05-07 04:59:09
啊,我错过了解释结构。我的答案已更新。 – luttkens 2013-05-07 05:10:59