shuffle

(PHP 3>= 3.0.8, PHP 4 >= 4.0.0)

shuffle -- Zamφchat pole

Popis

void shuffle ( array array)

shuffle() zamφchß (nßhodn∞ zm∞nφ po°adφ prvk∙) pole. Musφte inicializovat generßtor nßhodn²ch Φφsel pomocφ srand().

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

$numbers = range (1,20);
srand ((double)microtime()*1000000);
shuffle ($numbers);
while (list (, $number) = each ($numbers)) {
    echo "$number ";
}

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