$arr=array(
'0'=>array(
'a'=>2,
'b'=>'fd',
'c'=>'fgd',
'd'=>'hg',
),
'1'=>array(
'e'=>2,
'b'=>'fd',
'f'=>'fgd',
),
'2'=>array(
'a'=>2,
'c'=>'fd',
'e'=>'fgd',
'b'=>'hg',
),
'3'=>array(
'c'=>2,
'd'=>'fd',
'e'=>'fgd',
'f'=>'hg',
),
);
foreach($arras$k=>$v){
foreach($vas$key=>$val){
$arr2[$key]=$val;
}
}
//计算一维数组中某个字段值的和:
<?php
$a=array(0=>"5",1=>"15",2=>"25");
$total = 0;
foreach($a as $num){
$total+=$num;
}
?>