Array
(
[1] => a
[2] => b
[3] => c
[0] => d
[4] => e
)
以下为目标数组
Array
(
[0] => d
[1] => a
[2] => b
[3] => c
[4] => e
)
解决办法:
ksort($arr);
怎样把数组中的元素按键名大小排列
时间: 2024-10-31 04:25:22
Array
(
[1] => a
[2] => b
[3] => c
[0] => d
[4] => e
)
以下为目标数组
Array
(
[0] => d
[1] => a
[2] => b
[3] => c
[4] => e
)
解决办法:
ksort($arr);
怎样把数组中的元素按键名大小排列