相关疑难解决方法(0)

通过多个键对多维数组进行排序

我试图通过多个键对多维数组进行排序,我不知道从哪里开始.我看着uasort,但不太确定如何为我需要的东西编写函数.

我需要按州,然后是event_type,然后按日期排序.

我的数组看起来像这样:

    Array
(
    [0] => Array
        (
            [ID] => 1
            [title] => Boring Meeting
            [date_start] => 2010-07-30
            [time_start] => 06:45:PM
            [time_end] => 
            [state] => new-york
            [event_type] => meeting
        )

    [1] => Array
        (
            [ID] => 2
            [title] => Find My Stapler
            [date_start] => 2010-07-22
            [time_start] => 10:45:AM
            [time_end] => 
            [state] => new-york
            [event_type] => meeting
        )

    [2] => Array
        (
            [ID] => 3
            [title] => Mario Party
            [date_start] => 2010-07-22
            [time_start] => 02:30:PM
            [time_end] => 07:15:PM
            [state] => …
Run Code Online (Sandbox Code Playgroud)

php arrays sorting multidimensional-array

77
推荐指数
3
解决办法
6万
查看次数

标签 统计

arrays ×1

multidimensional-array ×1

php ×1

sorting ×1