我需要将数组项的顺序更改为预定义的顺序。
原始数组是
$order = array(3136,3121,3147,3125);
Array
(
[3121] => Array
(
[0] => 311
[1] => 311>
[2] => First Level
)
[3125] => Array
(
[0] => 312
[1] => 312>
[2] => Ids
)
[3136] => Array
(
[0] => 313
[1] => 313>
[2] => Insurance
)
[3147] => Array
(
[0] => 314
[1] => 314>
[2] => Property
)
)
需要像下面这样生成,
Array
(
[3136] => Array
(
[0] => 313
[1] => 313>
[2] => Insurance
)
[3121] => Array
(
[0] => 311
[1] => 311>
[2] => First Level
)
[3147] => Array
(
[0] => 314
[1] => 314>
[2] => Property
)
[3125] => Array
(
[0] => 312
[1] => 312>
[2] => Ids
)
)
base 将是数组元素的键,在 3136 元素之后 3121 将被推送然后 3147 等等