title: PHP how to properly loop through json with multiple levels as object
body: <p>Here is the Json data stored in variable $json</p>
  
  <pre><code>[Data] =&gt; Array
          (    
      [id_number] =&gt; Array
              (
                  [value] =&gt; 123445567
                  [link] =&gt; &lt;a href="some_link"&gt;1234556&lt;/a&gt;
                  [class] =&gt; 
              )
  
          [date] =&gt; Array
              (
                  [value] =&gt; 04-18-14
                  [link] =&gt; &lt;a href="some_link"&gt;1234556&lt;/a&gt;
                  [class] =&gt; 
              )
  </code></pre>
  
  <p>Currently I access the lower levels like this:</p>
  
  <pre><code>foreach($json['Data'] as $data) {
    foreach ($data['id_number'] as $id) {
        print $id['value'];
    }
  }
  </code></pre>
  
  <p>There is only one result for id_number and only one result for date. Do I really need this second foreach loop? Isn't there a way to access it by just going to the lower level as an object so it would be something like</p>
  
  <p><code>print $data-&gt;id_number-&gt;value</code></p>
  
  <p>Thank you.</p>