Use two rand()'s.
$foo = rand(2);
if ($foo == 0)
rand(first_set);
else
rand(second_set);
Niklas
-----Original Message-----
From: Jeff Sittler [mailto:[EMAIL PROTECTED]]
Sent: 14. maaliskuuta 2002 7:50
To: [EMAIL PROTECTED]
Subject: Re: [PHP] rand()
the min and max would work if I wanted the number between 33 and 146,
but I am wanting to specify two ranges, not just one.
Please RTFP
Jeff
"Jason Wong" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> On Thursday 14 March 2002 13:31, Jeff Sittler wrote:
> > I am wanting to use rand() to generate a number between 33-90 OR
125-146.
> > Is there a way to do this? I don't want any numbers before 33 or
between
> > 91-124 or after 146. Could someone point me in the direction I need
> > to look to accomplish this.
>
> rand(min, max);
>
> Please RTFM.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
>
> /*
> Man and wife make one fool.
> */
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php