1個數組:我想從多個陣列獲得相同的鍵的總和
Array
(
[0] => Array
(
[sales] => Array
(
[0] => Array
(
[Date] => 2014-04-01
[Units] => 1
)
[1] => Array
(
[Date] => 2014-04-02
[Units] => 7
)
)
第二陣列::
Array
(
[0] => Array
(
[sales] => Array
(
[0] => Array
(
[Date] => 2014-04-01
[Units] => 3
)
[1] => Array
(
[Date] => 2014-04-02
[Units] => 2
)
)
第三陣列::
Array
(
[0] => Array
(
[sales] => Array
(
[0] => Array
(
[Date] => 2014-04-01
[Units] => 0
)
[1] => Array
(
[Date] => 2014-04-02
[Units] => 5
)
)
所需的輸出::
Array
( [0] => Array
(
[Date] => 2014-04-01
[Units] => 4
),
[1] => Array
(
[Date] => 2014-04-02
[Units] => 14
),
)
詢問代碼的問題必須**證明對問題正在解決**。包括嘗試解決方案,爲什麼他們沒有工作,以及預期的結果。另請參閱:[堆棧溢出問題清單](http://meta.stackexchange.com/questions/156810/stack-overflow-question-checklist)。 –