 <p>The $id item is contained in an ID item. Try:</p> <pre><code>$id = $item['ID']['$id']; </code></pre> <p>Edit: I am not sure why you have the nested loops. This should be enough:</p> <pre><code>foreach ($json as $key1 =&gt; $item) { $id = $item['ID']['$id']; echo gmdate("d-m-Y H:i", strtotime('+2 hours', $item['datum'])) . '&amp;nbsp;' . $item['titel'] . ' met ID: '.$id.'&lt;br/&gt;'; } </code></pre>