$n = rand(33, 112);
if ($n > 90)  $n += 34;

not tested in code, but logically, this should work

Martin

-----Original Message-----
From: Jeff Sittler [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 14, 2002 4:31 PM
To: [EMAIL PROTECTED]
Subject: [PHP] rand()


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.

Thanks,
Jeff



-- 
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

Reply via email to