title: JSON Decode returning undefined index
body: <p>I have a json file called articles.json and these are the contents:</p>
  
  <pre><code>{
    "articles": [
      {
          "id": 1,
          "title": "a"
      }
    ]
  }
  </code></pre>
  
  <p>And here is the file where I am decoding it:</p>
  
  <pre><code>&lt;?php
    include "inc/header.inc.php";
  
    $file = file_get_contents("articles.json");
    $arts = json_decode($file, true);
  ?&gt;
  &lt;div class="container"&gt;
    &lt;h1&gt;Articles&lt;/h1&gt;
  &lt;/div&gt;
  &lt;div class="grey"&gt;
    &lt;div class="container"&gt;
    &lt;?php
      foreach($arts as $article) {
        print_r($article);
        echo "&lt;div class='part'&gt;";
          echo "&lt;div class='part-header'&gt;".$article['title']."&lt;/div&gt;";
        echo "&lt;/div&gt;";
      }
    ?&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;?php
    include "inc/footer.inc.php";
  ?&gt;
  </code></pre>
  
  <p>And I get the following error: <code>Notice: Undefined index: title in /vagrant/www/ComputingEssentials/articles.php on line 19</code></p>