shuffle
PHP -> Funkcie -> Array funkcie -> shuffle
Syntax
void shuffle(array arr);
Popis
Príkaz jazyka PHP
shuffle - Shuffle an array
This function shuffles (randomizes the order of the elements in) an array.
Príklad
$numbers = range(1,20);
srand(time());
shuffle($numbers);
while (list(,$number) = each($numbers)) {
echo "$number ";
}
srand(time());
shuffle($numbers);
while (list(,$number) = each($numbers)) {
echo "$number ";
}
Pozri aj
arsort, asort, ksort, rsort, sort, usort