★ wanayoo — archive 1999 http://www.php.net/manual/hu/function.rsort.phpNouvelle recherche | Portail wanayoo

PHP Home Page

Manual Table of Contents
Up to Tömbök
Quick Reference
English version of this pageGerman version of this pageJapanese version of this pageItalian version of this pageFrench version of this page
Tömbök
* array
* array_count_values
* array_diff
* array_flip
* array_intersect
* array_keys
* array_merge
* array_merge_recursive
* array_multisort
* array_pad
* array_pop
* array_push
* array_rand
* array_reverse
* array_shift
* array_slice
* array_splice
* array_unique
* array_unshift
* array_values
* array_walk
* arsort
* asort
* compact
* count
* current
* each
* end
* extract
* in_array
* key
* krsort
* ksort
* list
* next
* pos
* prev
* range
* reset
* rsort
* shuffle
* sizeof
* sort
* uasort
* uksort
* usort
Manual: rsort
View the source code for this pageSearch the site



Previous page
 reset
 Updated
Sat, 12 Aug 2000
shuffle 
Next page


rsort

(PHP3 , PHP4 )

rsort -- Sort an array in reverse order

Description

void rsort (array array [, int sort_flags])

This function sorts an array in reverse order (highest to lowest).

Példa 1. Rsort() example


$fruits = array ("lemon", "orange", "banana", "apple");
rsort ($fruits);
reset ($fruits);
while (list ($key, $val) = each ($fruits)) {
    echo "$key -> $val\n";
}
      

This example would display:


fruits[0] = orange
fruits[1] = lemon
fruits[2] = banana
fruits[3] = apple
      

The fruits have been sorted in reverse alphabetical order.

You may modify the behavior of the sort using the optional parameter sort_flags, for details see sort().

See also: arsort(), asort(), ksort(), sort(), and usort().


 About Notes


Previous page
 reset
 Updated
Sat, 12 Aug 2000
shuffle 
Next page





Who's responsible for this?
Top of this page

Site
Hosting:



Located in
United States
Elements of this website are subject to copyright.
Questions about installing or using PHP should be directed to one of the mailing lists.
Only questions about the website should be directed to webmaster@php.net.