Juntar array com valores iguais e somar os pontos
Preciso juntar os arrays que são com o valor de código iguais e somar os pontos, tenho esse exemplo:
[1] => Array
(
[match_id] => 21
[player_backup] => 65263
[player_points_new] => 450
[player_class_points] => 77
[player_bonus_ranking] => 0
[player_bonus_quality] => 0
[player_bonus_quantity] => 0
[club] =>
[club_points_new] => 0
[total_points] => 450
)
[2] => Array
(
[match_id] => 4
[player_backup] => 65263
[player_points_new] => 135
[player_class_points] => 4
[player_bonus_ranking] => 0
[player_bonus_quality] => 0
[player_bonus_quantity] => 0
[club] =>
[club_points_new] => 0
[total_points] => 135
)
[3] => Array
(
[match_id] => 21
[player_backup] => 65263
[player_points_new] => 22
[player_class_points] => 5
[player_bonus_ranking] => 0
[player_bonus_quality] => 0
[player_bonus_quantity] => 0
[club] =>
[club_points_new] => 0
[total_points] => 22
)
O match_id é o código igual, lembrando que ele pode se repetir varias vezes e ai tenho que unir todos os que tem o mesmo match_id somando apenas o total_pointsDiscussão (1)
Carregando comentários...