I have a PHP array like this..
Array
(
[0] => Array
(
[item] => 1
[hour] => 04
)
[1] => Array
(
[item] => 5
[hour] => 04
)
[2] => Array
(
[item] => 1
[hour] => 09
)
)
I am trying to create a new array so I can track how many items are purchased in which hour and spot hourly trends.
I think I need to end up with an array that looks like this
Array
(
[item1] => Array
(
[hour04] => 1
[hour09] => 1
)
[item5] => Array
(
[hour04] => 1
)
)
Is this the correct approach, or is there a better way to represent the final data?