Sum elements of array the same key?
<p>My function</p>

<pre><code>function array_push_assoc(&amp;$array, $key, $value){
    echo $key.".".$value."&lt;p&gt;";
    $array[$key] = $value;
    return $array;
}
</code></pre>

<p>OUTPUT</p>

<pre><code>USD.736.00

USD.100.00

Array
(
    [USD] =&gt; 100.00
)

EUR.736.00

USD.100.00

Array
(
    [EUR] =&gt; 736.00
    [USD] =&gt; 100.00
)
</code></pre>

<p>I WANT OUTPUT</p>

<pre><code>USD.736.00

USD.100.00

Array
(
    [USD] =&gt; 836.00 // sum all the same currency
)

EUR.736.00

USD.100.00

Array
(
    [EUR] =&gt; 736.00
    [USD] =&gt; 100.00
)
</code></pre>

<p>Anybody Know how to do this?Please help .Thanks</p>
