I have a multi dimensional array with some data.
Array ID Date Quantity
66998 [0] [2011-05-11] [50]
[1] [2011-05-15] [50]
[2] [2011-05-15] [50]
81158 [0] [2011-05-11] [25]
[1] [2011-05-12] [60]
[2] [2011-05-16] [60]
[3] [2011-05-18] [60]
I would like to add up all the Quantities from orders within same week. I can calculate the week number with:
$WeekNumber = date("W", $UnixTimestamp);
So the final array should look like this:
Week Quantity
66998 [0] [19] [150]
81158 [0] [19] [85]
[1] [20] [120]
The array is generated from MS SQL database.