My array is as follows:
Array ( [01:00 pm] => Lunch [03:00 pm] => Dance [12:45 pm] => Guests arrive [12:50 pm] => Find seats [12:55 pm] => Blessing )
I need to convert these keys to a customized time format for sorting so that a correct order would look like this:
Array ( [12:45 pm] => Guests arrive [12:50 pm] => Find seats [12:55 pm] => Blessing [01:00 pm] => Lunch [03:00 pm] => Dance )
But that's not all. These parties often end at 1am or 2am in the morning. Therefore it would make sense to start the clock with 3am being the first value. As such, a 02:00 am entry would appear at the end of the sorted list and a 05:00 am entry would appear at the very beginning (because I want to designate 03:00 am as the beginning of the clock.
If I had a 02:00 am and 05:00 am example in the array, it would read as:
Array ( [05:00 am] => Wake up [12:45 pm] => Guests arrive [12:50 pm] => Find seats [12:55 pm] => Blessing [01:00 pm] => Lunch [03:00 pm] => Dance [02:00 am] => Party ends)
I don't know where or how to transform the keys from the array. I currently have:
ksort($event_order);
foreach ( $event_order as $time => $event) {
echo '<div><strong>';
echo $time;
echo '</strong> - ';
echo $event;
echo '</div>';
}