total value with the same keys within multiple dim array of php
<p>I have an array like this:</p>

<pre><code>$a = array(
    array('amount'=&gt;10,'curr'=&gt;'USD'),
    array('amount'=&gt;20,'curr'=&gt;'JPY'),
    array('amount'=&gt;30,'curr'=&gt;'BAT'),
    array('amount'=&gt;50,'curr'=&gt;'BAT'),
    array('amount'=&gt;100,'curr'=&gt;'USD')
    );
</code></pre>

<p>I want to sum all amount the same currency together and return like this:</p>

<pre><code>$total = array('BAT'=&gt;80,
              'JPY'=&gt;20,
              'USD'=&gt;110
           )
</code></pre>
