按键值排序数组并显示键

时间:2013-06-03 19:57:04

标签: php arrays

我有这个数组

Array (
    [0] => Array
        (
            [id] => 61
            [testo] => articolo di maggio
            [data] => 2013-05-03
            [orario] => 00:00:00
            [nome_files] => fabmad_1920x1200.jpg
            [pubblicato] => 1
        )

    [1] => Array
        (
            [id] => 58
            [testo] => 
            [data] => 2013-06-03
            [orario] => 00:00:00
            [nome_files] => 20130603100647_da_installare.rtf
            [pubblicato] => 1
        )

    [2] => Array
        (
            [id] => 59
            [testo] => Demo
            [data] => 2013-06-03
            [orario] => 00:00:00
            [nome_files] => eye_drops_water_2.jpg
            [pubblicato] => 1
        )


)

我想按“数据”对其进行排序。 我想显示“数据”,并为每个数据显示元素......

1 个答案:

答案 0 :(得分:0)

尝试使用kso​​rt函数或array-multisort

查看php文档:http://php.net/manual/en/function.ksort.php http://php.net/manual/en/function.array-multisort.php

相关问题