title: Q: illegal string offset JSON -> PHP
body: <p>I already view a lot of questions in stackoverflow about my problem, but I didn't find any solution. I don't know where is the problem in my code? I got illegal string offset message at this row:</p>
  
  <pre><code>echo $value["country"] . ", " . $value["competition"] . "&lt;br&gt;";
  </code></pre>
  
  <p>My full code:</p>
  
  <pre><code>&lt;?php
  
  // file_get_contents call instead
  $str = file_get_contents('general.json');
  
  $json = json_decode($str,true);
  
   foreach($json as $key =&gt; $value){
  
  echo $value["country"] . ", " . $value["competition"] . "&lt;br&gt;";
  
  }
  ?&gt;
  </code></pre>
  
  <p>my json source sample:</p>
  
  <pre><code>["{\"country\":\"America\",\"competition\":\"Copa America\",\"club\":\"BOCA JUNIORS\"}","{\"country\":\"Germany\",\"competition\":\"Bundesliga\",\"club\":\"HANNOVER\"}","{\"country\":\"Asia\",\"competition\":\"JLeague\",\"club\":\"NAGOYA\"}"]
  </code></pre>
  
  <p>If I view format of the data with var_dump($json) then I see it is an Array. With var_dump($value) then I see there is a string. Please help for me where is the problem in my code, why could not echo value country and value competition?</p>