Re: Randomiser
| From: | Chris | Date: | Fri, 17 Oct 2008 00:30:28 +0000 |
| Subject: | Re: Randomiser | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-282011@lists.php.net to get a copy of this message | ||
Andrew Barnett wrote:
Hey All, I'm trying to work out how to randomise the order of a bunch of strings I have. I know how to pick one random string from a bunch of them, but how do I make sure that everyone is used just once.$used_strings = array(); while (true) { $string = get_random_string(); if (!isset($used_strings[$string])) {
$used_strings = 1;
break;
}
}
--
Postgresql & php tutorials
http://www.designmagick.com/