title: How to parse JSON array of objects in PHP
body: <p>I am new to php programming. Here in my project I am trying to parse JSON data coming from php web service. Here is the code in web service.</p>
  
  <pre><code>$query = "select * from tableA where ID = 1";
  $result = mysql_query($query);
  if (mysql_num_rows($result) &gt; 0) {
      $arr= array();
      while ($row = mysql_fetch_assoc($result)) {
          $arr['articles'][] = $row;
      }
      header('Content-type: application/json');
      echo json_encode($arr);
  }
  else{
      echo "No Names";
  }
  </code></pre>
  
  <p>This is giving me data in this JSON format.</p>
  
  <pre><code>{"articles":[{"ID":"1","Title":"Welcome","Content":"This is the first article."}]}
  </code></pre>
  
  <p>Now here is my php page code.</p>
  
  <pre><code>&lt;?php
  $jfile = file_get_contents('http://localhost/api/get_content.php');
  $final_res = json_decode($jfile, true) ;
  var_dump( $final_res );
  $content = $final_res-&gt;articles-&gt;Content;
  ?&gt;
  </code></pre>
  
  <p>I want to show the content on webpage.</p>
  
  <p>I know code at <code>var_dump( $final_res );</code> is working. But after that code is wrong. I tried to look at many tutorials to find the solution but didn't find anyone. I don't know where I am wrong.</p>