title: JSON Parsing Multiple Objects
body: <p>I need to extract below fields from JSON, cant able to traverse some objects.</p>
  
  <p>jSON (<a href="https://api.myjson.com/bins/19l74k" rel="nofollow noreferrer">https://api.myjson.com/bins/19l74k</a>)</p>
  
  <p>Here is loop code</p>
  
  <pre><code>$results = json_decode($json,true);
  
          foreach($results['data'] as $res){
              echo $res['message']."&lt;br/&gt;&lt;br/&gt;";
              echo $res['shares']."&lt;br/&gt;&lt;br/&gt;";
              echo "&lt;hr/&gt;";
  
          }
  </code></pre>
  
  <p>Need to extract Shares Count, Comments(total_count),reactions(total_count). I tried looping shares with ['data'] but undefined index issue.</p>