title: How to iterate through array of dictionary in PHP
body: <p>I have the following PHP code:</p>
  
  <pre><code>&lt;?php
      exec("./mycode.py", $out)
      var_dump($out) 
  
  ?&gt;
  </code></pre>
  
  <p>It produces the following output:</p>
  
  <pre><code>array(2) { [0]=&gt; string(28) "{"ky2": "bar", "ky1": "foo"}" [1]=&gt; string(30) "{"ky2": "bar2", "ky1": "foo2"}" }
  </code></pre>
  
  <p>How can I iterate the output above and print the result?</p>
  
  <pre><code> Entry 0
      ky1 - foo
      ky2 - bar
   Entry 1
      ky1 - foo2
      ky2 - bar2
  </code></pre>
  
  <p>They Python code (<code>mycode.py</code>) is this:</p>
  
  <pre><code>#!/usr/bin/env python
  import json
  dict1 = {'ky1':'foo', 'ky2':'bar'}
  dict2 = {'ky1':'foo2', 'ky2':'bar2'}
  print json.dumps(dict1)
  print json.dumps(dict2)
  </code></pre>
  
  <p>It prints this:</p>
  
  <pre><code>{"ky2": "bar", "ky1": "foo"}
  {"ky2": "bar2", "ky1": "foo2"}
  </code></pre>