I'm trying to add up two multidimensional arrays, both equally sized, field by field. I.e.:
$sum[4][3] = $a[4][3] + $b[4][3];
Or:
$a = array( array(1, 4), array(3, 2));
$b = array( array(9, 2), array(1, 0));
Should result in:
$sum = array( array(10, 6), array(4, 2));
Is there a more elegant way than foreaching over all the arrays?