t; -Stewart
>
> -Original Message-
> From: Sebastian Sprenger [mailto:[EMAIL PROTECTED]]
> Sent: 04 May 2001 10:21
> To: [EMAIL PROTECTED]
> Subject: [PHP] Choosing a random value out of two
>
>
> hi. i want to randomly assign either "value1" or "value2"
srand((double) microtime() * 100);
$which = rand(0,1);
$variable = ($which)? $value1 : $ value2;
-Stewart
-Original Message-
From: Sebastian Sprenger [mailto:[EMAIL PROTECTED]]
Sent: 04 May 2001 10:21
To: [EMAIL PROTECTED]
Subject: [PHP] Choosing a random value out of two
hi. i
hi. i want to randomly assign either "value1" or "value2" to a $variable.
how can that be done?
thanks,
Sebastian
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e
3 matches
Mail list logo