rsort

(PHP 3, PHP 4 >= 4.0.0)

rsort -- T°φdit pole sestupn∞

Popis

void rsort ( array array [, int sort_flags])

Tato funkce sestupn∞ t°φdφ pole.

P°φklad 1. Ukßzka rsort()

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

Tato ukßzka zobrazφ:

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

Ovoce bylo set°φd∞no podle abecedy sestupn∞.

Vlastnosti t°φd∞nφ lze upravit pomocφ volitelnΘho argumentu sort_flags, detaily viz sort().

Viz takΘ: arsort(), asort(), ksort(), sort() a usort().