如何根据值特定地排序多维数组

时间:2017-01-23 07:00:06

标签: php arrays

我有以下数组:

Array
(
    [1150] => Array
        (
            [name] => test1
            [start_date] => 2017-01-12 00:00:00
            [end_date] => 1485801000

        )
    [1139] => Array
        (
            [name] => test2
            [start_date] => 2017-01-12 00:00:00
            [end_date] => 1484418600

        )
    [1131] => Array
        (
            [name] => test3
            [start_date] => 2017-01-12 00:00:00
            [end_date] => 1484418600

        )
    [1123] => Array
        (
            [name] => test1
            [start_date] => 2017-01-11 00:00:00
            [end_date] => 1484764200

        )   
)

现在我想根据降序开始日期对其进行排序。

1 个答案:

答案 0 :(得分:0)

我同意@Weedoze的评论,但如果它的php在这里很少有链接

http://php.net/manual/ru/datetime.diff.php

How to compare two dates in php