PHP » PYTHON |
login |
register |
about
|
The following requires Python 2.4+:
array.sort(reverse=True) result = sorted(array, reverse=True) # does not change input array rsort(PHP 4, PHP 5) rsort — Sort an array in reverse order Description
bool rsort
( array &$array
[, int $sort_flags= SORT_REGULAR
] )
This function sorts an array in reverse order (highest to lowest). Parameters
Return ValuesReturns TRUE on success or FALSE on failure. Examples
Example #1 rsort() example
<?php The above example will output: 0 = orange 1 = lemon 2 = banana 3 = apple The fruits have been sorted in reverse alphabetical order.
Notes
See Also
|
more
Recently updated
more
Most requested
more
Last requests
|