Looping through array and totalling values

MEL

New Member
I require a bit of assistance, if someone would be kind enough to help.I have an array with values, which I want to loop through, and if any of the 'user_id values' are the same then to total the 'max_score' value of the duplicate user id's.Array( [0] => Array ( [user_id] => 2 [max_score] => 10081 ) [1] => Array ( [user_id] => 1 [max_score] => 8774 ) [2] => Array ( [user_id] => 2 [max_score] => 5477 ) [3] => Array ( [user_id] => 3 [max_score] => 5267 ) [4] => Array ( [user_id] => 1 [max_score] => 5010 ))Would anyone know how to accomplish this?Many thanks.
 
Back
Top