title: PHP foreach Invalid argument supplied when decode json
body: <p>I have to decode json data and insert it to database.</p>
  
  <p>My code: </p>
  
  <pre><code>include 'db.php';
  $jsonString = file_get_contents('../question.json');
  $data = json_decode($jsonString, true);
  $x=1;
  foreach ($data as $key1 =&gt; $val1) {
  </code></pre>
  
  <p>And e error :
  Invalid argument supplied for foreach() in /includes/php/transfer.php on line 6</p>
  
  <p>foreach is my 6th line of code. </p>
  
  <p>I did not get it.. where is a issue?</p>