title: Loop JSON String response in PHP Foreach
body: <p>I'm trying to print values of a JSON response in PHP. Inside the contents are:</p>
  
  <pre><code>data
  local
  acao
  detalhes
  </code></pre>
  
  <p>Codes:</p>
  
  <pre><code>&lt;?php
  header('Content-type: text/html; charset=UTF-8');
  
  $url = "http://developers.agenciaideias.com.br/correios/rastreamento/json/RJ290474594CN";
  $c_url = file_get_contents($url); 
  $c_url = utf8_encode($c_url); 
  $results = json_decode($c_url); 
  
  echo $c_url;
  ?&gt;
  </code></pre>
  
  <p>I've tried using <code>foreach</code> but wasn't successful in implementing them in said JSON response.</p>
  
  <p>Here is a JSON String Example:</p>
  
  <pre><code>[{"data":"07\/12\/2014 11:19","local":"CHINA - CHINA\/CN","acao":"postado","detalhes":"-"},{"data":"09\/12\/2014 12:03","local":"CHINA - CHINA\/CN","acao":"encaminhado","detalhes":"Em tr\u00e2nsito para Unidade de Tratamento Internacional - BRASIL\/BR"},{"data":"29\/12\/2014 12:34","local":"UNIDADE TRAT INTERNACIONAL PARANA - Curitiba\/PR","acao":"conferido","detalhes":"Recebido\/Brasil "}]
  </code></pre>