SyntaxFix
Write A Post
Hire A Developer
Questions
$sumArray = array(); foreach ($myArray as $k=>$subArray) { foreach ($subArray as $id=>$value) { if(!isset($sumArray[$id])){ $sumArray[$id] =$value; }else { $sumArray[$id]+=$value; } } } print_r($sumArray); `