0
本人曾經多維數組這些值:array_sum()預計參數1是數組,雙給出
array
0 =>
array
0 => float 0.11521247274056
1 => float 0.081839214900844
2 => float 0.084168850912272
3 => float 0.18520831868443
1 =>
array
0 => float 0.92169978192452
1 => float 0.65471371920675
2 => float 0.84168850912272
3 => float 0.43215274359699
2 =>
array
0 => float 0.23042494548113
1 => float 0.13094274384135
2 => float 0.16833770182454
3 => float 0.18520831868443
3 =>
array
0 => float 0.038404157580188
1 => float 0.09353053131525
2 => float 0.056112567274848
3 => float 0.061736106228142
現在,我想是每個組的總和。類似:
[0] [0] + [0] [1] + [0] [2] + [0] [3]
有了這個代碼,我得到這個錯誤:array_sum()預計參數1是數組,雙定
for ($i = 0; $i < $numCol; $i++) {
for ($j = 0; $j < $numCol; $j++) {
$sumResult[] = array_sum($result[$i][$j]);
}
}
錯誤說你需要做的... – PeeHaa