I have a chatlog composed of a date and the actual entry after two spaces. Now I need to sort this by the time of the entry, but keep the order of the entries the same when the dates are equivalent.
Array
(
[0] => '6/4 17:01:30.001 X'
[1] => '6/4 17:01:30.003 B'
[2] => '6/4 17:01:30.003 C'
[3] => '6/4 17:01:30.003 A'
[4] => '6/4 17:01:30.002 Y'
)
I already tried a couple of things, creating a multidimensional array splitted in the dates an values sorting with a couple of different algorithms but I'm pretty sure there must be some really easy, and obvious way to do this without multiple loops.
The result should look like this:
Array
(
[0] => '6/4 17:01:30.001 X'
[4] => '6/4 17:01:30.002 Y'
[1] => '6/4 17:01:30.003 B'
[2] => '6/4 17:01:30.003 C'
[3] => '6/4 17:01:30.003 A'
)