krsort( ) function reverse sorts it by its keys while preserving the values : Array sort « Data Structure « PHP
- PHP
- Data Structure
- Array sort
krsort( ) function reverse sorts it by its keys while preserving the values
//bool krsort ( array &arr [, int options] )
<?
$capitalcities['England'] = 'London';
$capitalcities['Wales'] = 'Cardiff';
$capitalcities['Scotland'] = 'Edinburgh';
krsort($capitalcities);
?>
Related examples in the same category