arsort( ) function reverse sorts it by its values while preserving the keys : arsort « Data Structure « PHP






arsort( ) function reverse sorts it by its values while preserving the keys

 
//bool arsort ( array &arr [, int options] )

<?
    $capitalcities['England'] = 'London';
    $capitalcities['Wales'] = 'Cardiff';
    $capitalcities['Scotland'] = 'Edinburgh';
    arsort($capitalcities);
?>
  
  








Related examples in the same category

1.Reversing an Array Using arsort()
2.arsort() function maintains the original index association and sorts the elements in reverse order.
3.Sorting with arsort()