php - Sum array value per day in multidimensional array

前端 未结 3 434
野的像风
野的像风 2021-01-26 09:52

There are a number of great Q&As on Stackoverflow on how to sum across a multidimensional associative array but I have not found a working example of doing subtotals within

3条回答
  •  暖寄归人
    2021-01-26 10:10

    You can try this one:

    foreach($myArray as &$value){
        if(is_array($value)){
             $value = array_sum($value);
        }
    }
    

提交回复
热议问题