从数组中获取最低值并删除重复项

时间:2018-06-16 11:05:39

标签: php arrays sorting

我需要:  1.获取[id_vehicle]的最低值[alert]  2.删除[id_vehicles]的重复项  3.按[id_vehicle]

排序数组

所以在这种情况下,最低值是2016-03-07。我怎样才能做到这一点?这是我的阵列:

Array
    (
        [0] => stdClass Object
            (
                [id] => 2
                [id_vehicle] => 35
                [remind] => 2016-03-07
                [alert] => 2016-10-09
            )

        [1] => stdClass Object
            (
                [id] => 3
                [id_vehicle] => 35
                [remind] => 2016-05-02
                [alert] => 2016-03-07
            )

        [2] => stdClass Object
            (
                [id] => 4
                [id_vehicle] => 35
                [remind] => 2016-08-01
                [alert] => 2016-05-02
            )

        [3] => stdClass Object
            (
                [id] => 5
                [id_vehicle] => 35
                [remind] => 2016-11-07
                [alert] => 2016-08-01
            )

0 个答案:

没有答案