我有一个这样的数组:
Array
(
[0] => Saturday 19th January 2013 07:59:57 PM
[1] => Sunday 20th January 2013 07:00:26 PM
[2] => Monday 21st January 2013 02:08:15 PM
[3] => Monday 21st January 2013 02:11:00 PM
[4] => Monday 21st January 2013 02:41:02 PM
[5] => Monday 21st January 2013 02:42:14 PM
[6] => Monday 21st January 2013 03:03:34 PM
[7] => Monday 21st January 2013 03:07:39 PM
[8] => Monday 21st January 2013 03:37:11 PM
[9] => Monday 21st January 2013 03:37:52 PM
[10] => Monday 21st January 2013 04:14:08 PM
[11] => Monday 21st January 2013 04:16:38 PM
[12] => Monday 21st January 2013 04:19:18 PM
[13] => Monday 21st January 2013 05:45:17 PM
[14] => Monday 21st January 2013 06:39:04 PM
[15] => Monday 21st January 2013 08:01:56 PM
[16] => Monday 21st January 2013 08:03:23 PM
[17] => Monday 21st January 2013 08:12:15 PM
[18] => Monday 21st January 2013 08:15:20 PM
[19] => Monday 21st January 2013 08:29:57 PM
[20] => Monday 21st January 2013 09:57:25 PM
[21] => Tuesday 22nd January 2013 01:57:59 AM
[22] => Tuesday 22nd January 2013 06:39:34 AM
[23] => Tuesday 22nd January 2013 11:38:25 AM
[24] => Tuesday 22nd January 2013 03:21:08 PM
[25] => Tuesday 22nd January 2013 04:09:36 PM
}
我想对这个数组进行分组,以便得到:
Array
(
[Saturday 19th January 2013 07:59:57 PM] => 1
[Sunday 20th January 2013 07:00:26 PM] => 1
[Monday 21st January 2013 02:08:15 PM] => 19
[Tuesday 22nd January 2013 01:57:59 AM] => 5
}
这里的键应该是前一个数组中匹配 20-23 个字符的匹配值,值是前一个数组中匹配值的计数,我一直在努力解决这个问题。将不胜感激任何帮助!