 |
 |
 |
 |
Warning: include(../levoe_menu.php) [ function.include]: failed to open stream: No such file or directory in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/shuffle.html on line 46
Warning: include() [ function.include]: Failed opening '../levoe_menu.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/shuffle.html on line 46
|
 |
 |
 |
 | |
|  |
(PHP 3>= 3.0.8, PHP 4)
shuffle - перетряхивает массив. Описаниеvoid shuffle (array array)
Эта функция перетряхивает массив (перемешивает элементы в произвольном
порядке). Для этого вы обязаны посеять с помощью srand().
Пример 1. shuffle()
$numbers = range (1,20);
srand ((float)microtime()*1000000);
shuffle ($numbers);
while (list (, $number) = each ($numbers)) {
echo "$number ";
} |
|
См. также arsort(),
asort(), ksort(), rsort(),
sort() и usort(). |  | |
|
 |
 |
 |
 |
Warning: include(../pravoe_menu.php) [ function.include]: failed to open stream: No such file or directory in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/shuffle.html on line 146
Warning: include() [ function.include]: Failed opening '../pravoe_menu.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/shuffle.html on line 146
|
 |
 |
 |
 | |