首次发帖,请假高手
我从redis中取出五维数组需要处理相加,如下
希望数据处理后,相同date前提下,area里相同的key所对应的click和traffic值相加,即0和1这两个大数组,date为201001的,area中12所对应的click和traffic处理后应该是12和50,8对应的是6和60,其他类推,求遍历或其他能处理成功的方法,感激不尽~!
我从redis中取出五维数组需要处理相加,如下
$a = array(
0 => array(
0=> array(
"date" => "201201",
"area"=> array(
12 => array(
click => "3",
traffic => "30"
)
)
),
1=> array(
"date" => "201202",
"area"=> array(
12 => array(
click => "8",
traffic => "40"
),
8=> array(
click => "5",
traffic => "50"
)
)
)
),
1 => array(
0=> array(
"date" => "201201",
"area"=> array(
12 => array(
click => "9",
traffic => "20"
),
8=> array(
click => "6",
traffic => "60"
)
)
),
1=> array(
"date" => "201202",
"area" => NULL
)
),
);
希望数据处理后,相同date前提下,area里相同的key所对应的click和traffic值相加,即0和1这两个大数组,date为201001的,area中12所对应的click和traffic处理后应该是12和50,8对应的是6和60,其他类推,求遍历或其他能处理成功的方法,感激不尽~!