grouping array with the same key
<p>I have an array like this</p>

<pre><code>Array(
  [0] =&gt; Array([A] =&gt; 1)
  [1] =&gt; Array([B] =&gt; 3)
  [2] =&gt; Array([C] =&gt; 2)
  [3] =&gt; Array([A] =&gt; 2)
 )
</code></pre>

<p>I want an array something like this</p>

<pre><code>array(
     array('product' =&gt; 'A'), 'data' =&gt; array(1,2),
     array('product' =&gt; 'B'), 'data' =&gt; array(3),
     array('product' =&gt; 'C'), 'data' =&gt; array(2)  
)
</code></pre>
