<?php $v_4 = [ [1, 2, 3], [4, 5, 6], ]; $v_5 = [ [7, 8, 9], [10, 11, 12], ]; $result = []; foreach ($v_4 as $i => $row) { foreach ($row as $k => $v) { $result[$i][$k] = $v + $v_5[$i][$k]; } } var_export($result);
You have javascript disabled. You will not be able to edit any code.