如何按日期时间值排序数组[重复]

This question already has an answer here:

i have array like this:

Array
(
    [4] => Array
        (
            [dep] => 23:24
            [seconds] => 84240
            [date] => 2014-05-15 23:24:00
        )

    [3] => Array
        (
            [dep] => 04:49
            [seconds] => 17340
            [date] => 2014-05-16 04:49:00
        )

    [2] => Array
        (
            [dep] => 04:22
            [seconds] => 15720
            [date] => 2014-05-16 04:22:00
        )

    [1] => Array
        (
            [dep] => 04:07
            [seconds] => 14820
            [date] => 2014-05-16 04:07:00
        )

    [0] => Array
        (
            [dep] => 00:04
            [seconds] => 240
            [date] => 2014-05-16 00:04:00
        )

)

I would like sort and get something like: 1. 2014-05-15 23:24:00

  1. 2014-05-16 00:04:00

  2. 2014-05-16 04:07:00

  3. 2014-05-16 04:22:00

  4. 2014-05-16 04:49:00

Thanks for replay ;)

</div>

How about translating the values into unix time and sorting by that?

Thats probably the easiest solution:

sort(strtotime($array['date']));

Use strtotime on each of those fields and then sort them with asort.