Tech used: PHP 5.3.10
Hi, I have an array (example below) I need to manipulate by combining the same times, concat any applicable offerId's to a comma delimted string and finally return the string sorted by time! Not much then :)
I looked at this answer to ID the rows: https://stackoverflow.com/a/1019534/260023 however I drew a blank once I had identified the row how to modily the data in it...
Array
(
[0] => Array
(
[dateTime] => 2012-04-03T18:00:00
[offerIDs] =>
)
[1] => Array
(
[dateTime] => 2012-04-03T18:30:00
[offerIDs] =>
)
[2] => Array
(
[dateTime] => 2012-04-03T19:00:00
[offerIDs] =>
)
[3] => Array
(
[dateTime] => 2012-04-03T21:00:00
[offerIDs] =>
)
[4] => Array
(
[dateTime] => 2012-04-03T18:00:00
[offerIDs] => 17302
)
[5] => Array
(
[dateTime] => 2012-04-03T18:30:00
[offerIDs] => 17302
)
[6] => Array
(
[dateTime] => 2012-04-03T19:00:00
[offerIDs] => 17302
)
[7] => Array
(
[dateTime] => 2012-04-03T19:30:00
[offerIDs] => 17302
)
[8] => Array
(
[dateTime] => 2012-04-03T20:00:00
[offerIDs] => 17302
)
[9] => Array
(
[dateTime] => 2012-04-03T20:30:00
[offerIDs] => 17302
)
[10] => Array
(
[dateTime] => 2012-04-03T19:00:00
[offerIDs] => 17298
)
)
This should result in:
Array
(
[0] => Array
(
[dateTime] => 2012-04-03T18:00:00
[offerIDs] => 17302
)
[1] => Array
(
[dateTime] => 2012-04-03T18:30:00
[offerIDs] => 17302
)
[2] => Array
(
[dateTime] => 2012-04-03T19:00:00
[offerIDs] => 17302,17298
)
[6] => Array
(
[dateTime] => 2012-04-03T19:30:00
[offerIDs] => 17302
)
[7] => Array
(
[dateTime] => 2012-04-03T20:00:00
[offerIDs] => 17302
[8] => Array
(
[dateTime] => 2012-04-03T20:30:00
[offerIDs] => 17302
)
[9] => Array
(
[dateTime] => 2012-04-03T21:00:00
[offerIDs] =>
)
)