Re: Random numbers?
| From: | Patrik Wallstrom | Date: | Mon, 04 Feb 2002 03:48:00 +0000 |
| Subject: | Re: Random numbers? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-16477@lists.php.net to get a copy of this message | ||
On sön, 03 feb 2002, Chris Payne wrote:
> Hi there everyone,
>
> I need to generate a random number between 1 and 15 for insertion into a
> DB, I can easily do the DB side of it but what is the best method for
> quickly generating a random number between 1 and 15 (including 1 and 15
> in the equation)?
srand((double)microtime()*1000000);
$randomnumber = rand(1,15);
Something like this?
--
patrik_wallstrom->foodfight->pawal@blipp.com->+46-709580442