php代码 求数组平均值
$a3=array(array(11,12,13),array(21,22,23,24,25),array(31,32,33,35),array(41,42,43));...
$a3 = array(array(11,12, 13),array(21,22,23, 24, 25),array(31,32,33, 35),array(41,42,43));
展开
展开全部
$a3 = array(array(11,12, 13),array(21,22,23, 24, 25),array(31,32,33, 35),array(41,42,43));
$total = 0;
foreach($a3 as $key=>$value){
$total += array_sum($value);
}
$num = count($a3,COUNT_RECURSIVE);
$average = $total/$num;
echo $average;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询