multidimensional array array_sum

后端 未结 10 2007
深忆病人
深忆病人 2020-11-27 06:45

I have seen various posted about this question so am aware some answers to this may exist. however I am none the wiser after reading these.

I have an array that is

10条回答
  •  自闭症患者
    2020-11-27 07:00

    Just a way to do it:

    $sum = 0;
    
    foreach($account_invoices as $num => $values) {
        $sum += $values[ 'vatAmount' ];
    }
    

提交回复
热议问题