array_multisort : array_multisort « Data Structure « PHP






array_multisort

 
<?php

   $staff["givenname"][0] = "J";
   $staff["givenname"][1] = "M";
   $staff["givenname"][2] = "G";
   $staff["surname"][1] = "C";
   $staff["surname"][2] = "G";
   $staff["surname"][3] = "E";

   $res = array_multisort($staff["surname"],SORT_STRING,SORT_ASC,
                          $staff["givenname"],SORT_STRING,SORT_ASC);

   print_r($staff);

?>
  
  








Related examples in the same category

1.array_multisort for Array Keys with a Given Value