Posted By

takel on 01/08/11


Tagged

php sort array


Versions (?)

Array subval sort


 / Published in: PHP
 

  1. function subval_sort($a,$subkey)
  2. {
  3. foreach($a as $k=>$v)
  4. {
  5. $b[$k] = strtolower($v[$subkey]);
  6. }
  7. arsort($b);
  8. foreach($b as $key=>$val)
  9. {
  10. $c[] = $a[$key];
  11. }
  12. return $c;
  13. }

Report this snippet  

You need to login to post a comment.