I'm not able to find a solution for the given scenario where I have a multidimensional array in which I have to find the sum of the values of the arrays that have same ID.
demo.php
$array = array("1"=>array("id"=>"1", "total"=>"100"),
"2"=>array("id"=>"2", "total"=>"300"),
"3"=>array("id"=>"3", "total"=>"400"),
"4"=>array("id"=>"4", "total"=>"500"),
"5"=>array("id"=>"1", "total"=>"560"));
I want to get the sum of the total of all the duplicates IDs e.g 1 is the ID and the sum of the total would be 100 + 560 = 650.