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