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

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

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