note 9924 modified in function.shuffle by irc-html
| From: | irc-html@php.net | Date: | Sat, 19 Jan 2002 22:11:02 +0000 |
| Subject: | note 9924 modified in function.shuffle by irc-html | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-25512@lists.php.net to get a copy of this message | ||
It says you have to seed the generator with srand, but just for shuffling an array of fruits for
example, you just do shuffle...
$fruits = Array(
"apples" => "juicy",
"lemons" => "sour",
"tangerines" => "sweet");
shuffle($fruits);
print join("", $fruits);
--was--
It says you have to seed the generator with srand, but just for shuffling an array of fruits for
example, you just do shuffle...
$fruits = Array(
"apples" => "juicy",
"lemons" => "sour",
"tangerines" => "sweet");
shuffle($fruits);
print join("", $fruits);
http://www.php.net/manual/en/function.shuffle.php