I need a way to merge
Array(
[0] => Array
(
[event_id] => 1
[time] => '21:00pm'
[day] => 'Monday'
)
[1] => Array
(
[event_id] => 2
[time] => '18:00pm'
[day] => 'Monday'
)
[2] => Array
(
[event_id] => 3
[time] => '21:00pm'
[day] => 'Tuesday'
)
)
into:
Array (
[0] => Array
(
[event_id] => Array
(
[0] => 1
[1] => 2
)
[time] => Array
(
[0] => '21:00pm'
[1] => '18:00pm'
)
[day] => 'Monday'
)
[1] => Array
(
[event_id] => 3
[time] => '21:00pm'
[day] => 'Tuesday'
)
)
So the new array is grouped by the day key and if the values are different between the merged arrays then the merged value becomes an array.