title: Json decode foreach loop
body: <p>I want to make a foreach loop in my <code>json</code> decode script. I'm getting the info of an url, but that url has dynamic script, sometimes there are 4 results and sometimes 10 results.</p>
  <p>I have these now:</p>
  <pre><code> &lt;?php
   $json = file_get_contents('URL');
   $data = json_decode($json,true);
   ?&gt;
  
    &lt;strong&gt;Number&lt;/strong&gt;&lt;/a&gt; &lt;?php echo $data['Data'][1]['data']; ?&gt;&lt;br /&gt;
  </code></pre>
  <p>I have now id 1 in my script, but i want alle the id's in my script. Is this possible with foreach oid ?
  Else i have to make more rules.</p>
  <pre><code> &lt;strong&gt;Number&lt;/strong&gt;&lt;/a&gt; &lt;?php echo $data['Data'][1]['data']; ?&gt;&lt;br /&gt;
   &lt;strong&gt;Number&lt;/strong&gt;&lt;/a&gt; &lt;?php echo $data['Data'][2]['data']; ?&gt;&lt;br /&gt;
   &lt;strong&gt;Number&lt;/strong&gt;&lt;/a&gt; &lt;?php echo $data['Data'][3]['data']; ?&gt;&lt;br /&gt;
  </code></pre>
  <p>I googled and checked Stack Overflow but I cant find the solution to my problem.</p>