📜  php 添加具有相同键的数组值 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:54.526000             🧑  作者: Mango

代码示例1
$sumArray = array();

foreach ($myArray as $k=>$subArray) {
  foreach ($subArray as $id=>$value) {
    $sumArray[$id]+=$value;
  }
}

print_r($sumArray);