我有一个数组,需要排序(基于 id):
Array
(
[0] => Array
(
[qty] => 1
[id] => 3
[name] => Name1
[sku] => Model 1
[options] =>
[price] => 100.00
)
[1] => Array
(
[qty] => 2
[id] => 1
[name] => Name2
[sku] => Model 1
[options] => Color: <em>Black (+10$)</em>. Memory: <em>32GB (+99$)</em>.
[price] => 209.00
)
)
是否可以对我的数组进行排序以获得输出(基于 id)?
Array
(
[0] => Array
(
[qty] => 2
[id] => 1
[name] => Name2
[sku] => Model 1
[options] => Color: <em>Black (+10$)</em>. Memory: <em>32GB (+99$)</em>.
[price] => 209.00
)
[1] => Array
(
[qty] => 1
[id] => 3
[name] => Name1
[sku] => Model 1
[options] =>
[price] => 100.00
)
)
谢谢!