0
我正在處理一個統計應用程序,我想輸出每天發生的交互量。顯示日期排列的日數
我有一個多維數組,從數據庫中提取所有的信息,這裏有一個例子:
[0] => Array
(
[date] => 2012-07-26
[location] => 709c6d241674ca22
[action] => start_scan
)
[1] => Array
(
[date] => 2012-07-26
[location] => 709c6d241674ca22
[action] => scan_displayed
)
[2] => Array
(
[date] => 2012-07-27
[location] => 709c6d241674ca22
[action] => lower_device
)
[3] => Array
(
[date] => 2012-07-27
[location] => 709c6d241674ca22
[action] => how_to_use_displayed
)
[4] => Array
(
[date] => 2012-07-27
[location] => 709c6d241674ca22
[action] => raise_device
)
[5] => Array
(
[date] => 2012-07-28
[location] => 709c6d241674ca22
[action] => scan_displayed
)
我可以計算出發生在那一天每個交互通過格式化日期:
date('D', strtotime('2012-07-26'));
我的問題是如何計算一週中每天發生的交互次數,然後輸出它,如下所示:
[Sunday] => 2
[Monday] => 3
[Tueday] => 1
[Wednesday] => 5
[Thursday] => 10
[Friday] => 4
[Saturday] => 9
任何建議都非常感謝!