title: Array to Json with multiple same keys
body: <p>I have this simple array with 2 elements which is being converted into json format:</p>
  
  <pre><code>echo '['.json_encode(array("name" =&gt; "FRENCH POLYNESIA", "name" =&gt; "POLAND")).']';
  </code></pre>
  
  <p>The result is: <code>[{"name":"POLAND"}]</code></p>
  
  <p>In my case I need this result: <code>[{"name": "FRENCH POLYNESIA"},{"name": "POLAND"}]</code> How I can do this ?</p>