I have my array data as shown below:
Array (
[0] => Array ( [name] => Bank BRI [amount] => 0 )
[1] => Array ( [name] => Bank BRI [amount] => 0 )
[2] => Array ( [name] => Bank BCA [amount] => 1412341234 )
[3] => Array ( [name] => Bank CIMB Niaga [amount] => 532532552 )
[4] => Array ( [name] => Bank BRI [amount] => 34534534 )
[5] => Array ( [name] => Bank CIMB Niaga [amount] => 453425243 )
[6] => Array ( [name] => Bank BRI [amount] => 0 )
[7] => Array ( [name] => Bank BNI [amount] => 124124 )
[8] => Array ( [name] => Bank CIMB Niaga [amount] => 352345623 )
[9] => Array ( [name] => Bank BCA [amount] => 23432423 )
[10] => Array ( [name] => Bank Mandiri [amount] => 0 )
[11] => Array ( [name] => Bank BCA [amount] => 0 )
[12] => Array ( [name] => Bank BCA [amount] => 0 )
[13] => Array ( [name] => Bank Permata [amount] => 352352353 )
)
How to sum 'amount' based on same 'bank name'.
My data should shown like this:
Bank BRI........... with '*total amount*'
Bank BCA........... with '*total amount*'
Bank CIMB NIAGA.... with '*total amount*'
Bank BNI........... with '*total amount*'
Bank Mandiri....... with '*total amount*'
Bank Permata....... with '*total amount*'