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