我有一個由對象組成的數組。根據對象屬性對對象數組排序
[
{
"name" => "First",
"order" => 5
},
{
"name" => "Second",
"order" => 3
},
{
"name" => "Third",
"order" => 9
]
如何通過升序「order」值來訂購?
我應該得到:
[
{
"name" => "Second",
"order" => 3
},
{
"name" => "First",
"order" => 5
},
{
"name" => "Third",
"order" => 9
];
[按值排序多維數組(2)](http://stackoverflow.com/questions/2699086/sort-multidimensional-array-by-value-2) – deceze
請參閱[參考:所有基本方法在PHP中對數組進行排序](http://stackoverflow.com/q/17364127/476) – deceze