0

嗨,出于某些原因,当我使用表单(POST 方法)进行搜索时,我得到了一个如下所示的数组:

      Array(
            [0] =>Array ( [0] => 2008 [1] => Name1 [2] => Surname1 )
            [1] =>Array ( [0] => 2009 [1] => Name2 [2] => Surname2 ) 
            [2] =>Array ( [0] => 2010 [1] => Name3 [2] => Surname3 )
           )  

如何在不执行任何其他查询并使用 $_GET 参数或其他参数来获取如下所示的数组的情况下对该数组进行排序:

       Array(
            [0] =>Array ( [0] => 2010 [1] => Name3 [2] => Surname3 )
            [1] =>Array ( [0] => 2009 [1] => Name2 [2] => Surname2 ) 
            [2] =>Array ( [0] => 2008 [1] => Name1 [2] => Surname1 )
           ) 
4

1 回答 1

1

array_reverse()功能。

手册: http: //php.net/manual/en/function.array-reverse.php

于 2013-04-05T01:25:00.810 回答