How can I add all the columnar values by associative key? Note that key sets are dynamic.
Input array:
Arr
$sumArray = array(); foreach ($myArray as $k => $subArray) { foreach ($subArray as $id => $value) { if (!isset($sumArray[$id])) { $sumArray[$id] = 0; } $sumArray[$id]+=$value; } }