相关疑难解决方法(0)

如何按值排序多维数组?

如何通过"order"键的值对此数组进行排序?尽管这些值目前是连续的,但它们并不总是如此.

Array
(
    [0] => Array
        (
            [hashtag] => a7e87329b5eab8578f4f1098a152d6f4
            [title] => Flower
            [order] => 3
        )

    [1] => Array
        (
            [hashtag] => b24ce0cd392a5b0b8dedc66c25213594
            [title] => Free
            [order] => 2
        )

    [2] => Array
        (
            [hashtag] => e7d31fc0602fb2ede144d18cdffd816b
            [title] => Ready
            [order] => 1
        )
)
Run Code Online (Sandbox Code Playgroud)

php arrays sorting multidimensional-array

1058
推荐指数
11
解决办法
76万
查看次数

PHP中按值对多维关联数组进行排序

我有这组数组:

Array(
    [day_1] => Array(
        [3744] => Array(
            [time_start] => 11:00
            [time_end] => 12:00
            [notes] => 
        )
        [3746] => Array(
            [time_start] => 08:00
            [time_end] => 11:00
            [notes] => 
        )
        [532] => Array(
            [time_start] => 09:00
            [time_end] => 11:30
            [notes] => 
        )
    )
    [day_2] => Array(
        [3747] => Array(
            [time_start] => 08:00
            [time_end] => 10:00
            [notes] => 
        )
    )
)
Run Code Online (Sandbox Code Playgroud)

如何根据“time_start”的值对“day_1”中的数组进行排序?

我想要达到的最终结果是:

Array(
    [day_1] => Array(
        [3746] => Array(
            [time_start] => 08:00
            [time_end] => 11:00
            [notes] => 
        )
        [532] => Array( …
Run Code Online (Sandbox Code Playgroud)

php arrays sorting multidimensional-array

4
推荐指数
1
解决办法
7565
查看次数

标签 统计

arrays ×2

multidimensional-array ×2

php ×2

sorting ×2