title: JSON Invalid argument supplied for foreach()
body: <p>I have some issue to retrieve data from JSON, it always said <strong>Invalid argument supplied for foreach()</strong>, this is the JSON in the url.php :</p>
  
  <pre><code>[{"nama":"IT SERVICE &amp; SOLUTION","nilai":0,"periode":"11","tahun":"2014"},{"nama":"SUBDIV BUSINESS SERVICE","nilai":0,"periode":"11","tahun":"2014"},{"nama":"Data Analytics","nilai":100.1446,"periode":"11","tahun":"2014"}]
  </code></pre>
  
  <p>and this is my code :</p>
  
  <pre><code>&lt;?php
  $url="url.php";
  $json = file_get_contents($url);
  $koyim=  json_decode($json,true);
  foreach($koyim as $data){
      echo $data-&gt;nilai;
      echo $data-&gt;nama;
      echo "&lt;br/&gt;";
  }
  ?&gt;
  </code></pre>
  
  <p>I've been trying different things to retrieve the json but still not having the result, any idea for this ?</p>
  
  <p>thanks in advance</p>