0
我和數組,我想按[sys_title]鍵索引升序排列這個數組。我該怎麼辦?PHP數組Ascending排序
[0] => Array
(
[sys_id] => 9
[sys_title] => Checklist
[sys_home] => /cp/system/chl/
)
[1] => Array
(
[sys_id] => 8
[sys_title] => Bakery Ordering System
[sys_home] => /cp/system/bos/
)
預期結果應該是這樣的:
[0] => Array
(
[sys_id] => 8
[sys_title] => Bakery Ordering System
[sys_home] => /cp/system/bos/
)
[1] => Array
(
[sys_id] => 9
[sys_title] => Checklist
[sys_home] => /cp/system/chl/
)
使用usort()函數 – splash58
你能解釋一下嗎? –
http://php.net/manual/en/function.usort.php – splash58