title: Form a JSON get an multidimensional array in PHP
body: <p>I receive a json like this:</p>
  <pre><code>[{&quot;name&quot;:&quot;banana&quot;,&quot;country&quot;:&quot;Algeria&quot;},{&quot;name&quot;:&quot;Apple&quot;,&quot;country&quot;:&quot;China&quot;}]
  </code></pre>
  <p>How can I transform this to an array, where the key would be the <code>name</code> ?</p>
  <p>I'm using <code>json_decode($json, true);</code> but it creates an auto incremental keys.</p>
  <p>So I would like something like this:</p>
  <pre><code>Array
  (
      [banana] =&gt; Array
          (
              [country] =&gt; Algeria
          )
      [Apple] =&gt; Array
          (
              [country] =&gt; China
          )
  )
  </code></pre>
  <p>Thanks.</p>