title: Create foreach loop from JSON file
body: <p>I have a json file (items.json) that looks like following:</p>
  
  <pre><code>{"response":{"success":1,"current_time":1446373851,"items":[
  {
  "Item1": {"last_updated":1446372015,"quantity":73,"value":1200},
  "Item2": {"last_updated":1446372015,"quantity":40,"value":5297},
  "Item3": {"last_updated":1446372015,"quantity":148,"value":2507}
  }]}}
  </code></pre>
  
  <p>I've tried to create a for loop to create elements with values from each item in the json:</p>
  
  <pre><code>$values = file_get_contents( $siteurl.'/json/items.json');
  $values = json_decode($values);
  
  foreach ($values-&gt;items as $key =&gt; $value) {
  
  if($value==Item1 &amp;&amp; $value-&gt;value&gt;1000){
  &lt;p&gt;&lt;?php echo $value-&gt;value ; ?&gt;&lt;/p&gt;
  }
  }
  </code></pre>
  
  <p>In the above example i'm testing the first value in "items" (Item1). I'd like to be able to have a foreach for all these three items.</p>
  
  <p>But the browser outputs the following error "Warning: Invalid argument supplied for foreach() in".</p>
  
  <p>How do I correctly create a foreach where I can get values from all "items" objects (ex "Item1" and "Item2) that works for my json file format.</p>