我有一个像这样的多维数组:
Array(
[0] => Array(
[data] => Array(
[value] => 10,
[beta] => 0.5
),
[name] => 'bob'
),
[1] => Array(
[data] => Array(
[value] => 13,
[beta] => 0.6
),
[name] => 'Tim'
),
[2] => Array(
[data] => Array(
[value] => 19,
[beta] => 0.3
),
[name] => 'Chris'
)
)
有没有办法在value
不必迭代父数组的情况下对每个子子数组的元素求和?我正在使用 CakePHP,所以想知道该Hash
实用程序是否对此有所帮助。