title: Php - Combining lines of a single array with same values
body: <p>Basically I have this array:</p>
  
  <pre><code>$foo[0] = array("name" =&gt; "A", "apples" =&gt; "2");
  $foo[1] = array("name" =&gt; "B", "apples" =&gt; "4");
  $foo[2] = array("name" =&gt; "C", "apples" =&gt; "6");
  $foo[3] = array("name" =&gt; "A", "apples" =&gt; "3");
  $foo[4] = array("name" =&gt; "B", "apples" =&gt; "5");
  $foo[5] = array("name" =&gt; "C", "apples" =&gt; "7");
  </code></pre>
  
  <p>And I want this:</p>
  
  <pre><code>$foo[0] = array("name" =&gt; "A", "apple1" =&gt; "2", "apple2" =&gt; "3");
  $foo[1] = array("name" =&gt; "B", "apple1" =&gt; "4", "apple2" =&gt; "5");
  $foo[2] = array("name" =&gt; "C", "apple1" =&gt; "6", "apple2" =&gt; "7");
  </code></pre>