1
我有表示由日期分組的數據的計數3個陣列$dummyArray1 = array('year' => array('month' => 'count'));
PHP數組合並
$dummyArray1 = array(
'2012' => array(
'1' => 13,
'2' => 22,
'3' => 18,
'5' => 19
),
'2011' => array(
'1' => '4',
'3' => 13
)
);
$dummyArray2 = array(
'2012' => array(
'1' => 44,
'4' => 34,
'5' => 38,
'6' => 29
),
'2011' => array(
'1' => 9,
'2' => 11,
'3' => 1
)
);
$dummyArray3 = array(
'2012' => array(
'2' => 5,
'4' => 3,
'6' => 1,
'8' => 11
),
'2011' => array(
'3' => 9,
'4' => 14,
'9' => 9
)
);
我需要組中的那些1個陣列,使得每個月份我將每個陣列的count
值。如果計數數據在特定月份中不存在,則應該插入0
作爲count
值。
爲清楚起見,您可以加入一個例子你想要的輸出?謝謝。 – Wiseguy