I have a multidimensional array in the form of;
Array
(
[0] => Array
(
[DATE] => 05-19-2011
[PERSON] => Bob Hope
[ITEM] => Holiday
[DURATION] => 04:00
)
[1] => Array
(
[DATE] => 05-19-2011
[PERSON] => Bob Hope
[ITEM] => Work
[DURATION] => 05:00
)
[2] => Array
(
[DATE] => 05-19-2011
[PERSON] => Bob Hope
[ITEM] => Holiday
[DURATION] => 06:00
)
[3] => Array
(
[DATE] => 05-19-2011
[PERSON] => Bob Hope
[ITEM] => Work
[DURATION] => 05:00
)
[4] => Array
(
[DATE] => 05-19-2011
[PERSON] => Joe Bloggs
[ITEM] => Holiday
[DURATION] => 02:00
)
[5] => Array
(
[DATE] => 05-19-2011
[PERSON] => Joe Bloggs
[ITEM] => Work
[DURATION] => 03:00
)
[6] => Array
(
[DATE] => 05-19-2011
[PERSON] => Joe Bloggs
[ITEM] => Holiday
[DURATION] => 03:00
)
[7] => Array
(
[DATE] => 05-19-2011
[PERSON] => Joe Bloggs
[ITEM] => Work
[DURATION] => 02:00
)
)
And want to collate the results, totalling the holiday and work for each person so that I can output something in the form of;
Array
(
[0] => Array
(
[DATE] => 05-19-2011
[PERSON] => Bob Hope
[ITEM] => Holiday
[DURATION] => 10:00
)
[1] => Array
(
[DATE] => 05-19-2011
[PERSON] => Bob Hope
[ITEM] => Work
[DURATION] => 10:00
)
[2] => Array
(
[DATE] => 05-19-2011
[PERSON] => Joe Bloggs
[ITEM] => Holiday
[DURATION] => 05:00
)
[3] => Array
(
[DATE] => 05-19-2011
[PERSON] => Joe Bloggs
[ITEM] => Work
[DURATION] => 05:00
)
)
Any ideas? Any and all help appreciated.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…