I have an array in the form:
$sortme = array(
'Monday 10:00',
'Friday 12:00',
'Tuesday 14:00',
'Monday 08:00',
'Wednesday 11:00',
);
The number of elements is unknown (so I couldn't use the uksort approach with a reference array for the order of weekdays as Mark suggested here). I want the result to be sorted chronologically and always starting with Monday like this:
$sorted = array(
'Monday 08:00',
'Monday 10:00',
'Tuesday 14:00',
'Wednesday 11:00',
'Friday 12:00',
);
Is there an elegant way to do it without resorting to transform the array to a two-dimensional one and iterating? This would have been my only idea so far.