After using asort()to return the array's elements to their original order : asort « Data Structure « PHP






After using asort()to return the array's elements to their original order

 
<?php 

$nums = array(15, 2.2, -4, 2.3, 0); 
asort($nums); 
printf("<pre>%s</pre>\n", var_export($nums, TRUE)); 
ksort($nums); 
printf("<pre>%s</pre>\n", var_export($nums, TRUE)); 
?>
  
  








Related examples in the same category

1.asort( ) function sorts array by its values while preserving the keys
2.asort() Constants
3.asort() function works in the same way as sort() and preserves the array's original key/value associations.
4.asort() function: array indexes maintain their original association with the elements.
5.Sorting with asort()