title: Cannot iterate over array after json_decode(file_get_contents(filename))
body: <p>I want to write an Array as JSON into a file. Then i want to get the content, decode it and iterate over the array. The Problem is i cannot iterate over the Array that i get from the file. What am i doing wrong?
  var_dump() shows the array.</p>
  <pre><code>&lt;?php
  
  $array = array(
                  array(&quot;Artikel&quot; =&gt; &quot;Bananen&quot;,
                          &quot;Menge&quot; =&gt; 10,
                          &quot;id&quot; =&gt; &quot;4711&quot;
                  ),
                  array(&quot;Artikel&quot; =&gt; &quot;Eier&quot;,
                          &quot;Menge&quot; =&gt; 1,
                          &quot;id&quot; =&gt; &quot;abc&quot;
                  )
  );
  
  file_put_contents(&quot;daten.json&quot;, json_encode($array));
  
  
  $array1 = json_decode(file_get_contents(&quot;daten.json&quot;));
  
  var_dump($array1);
  
  for($i=0; $i&lt;count($array1); $i++){
    echo $array1[$i][&quot;Menge&quot;];
    echo &quot;&lt;br&gt;&quot;;
  }
  ?&gt;
  </code></pre>