PHP Array Ascending Sort -


i've , array, want sort array ascending order [sys_title] key index. should do?

[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/ ) 

expected result should this:

[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/ ) 

you can try piece of code:

usort($data,function($a,$b){     return strcmp($a['sys_title'],$b['sys_title']); });  print_r($data); 

Comments

Popular posts from this blog

libGdx unable to find files in android application data directory -

php - Webix Data Loading from Laravel Link -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -