Re: random no. between two numbers?

From: Date: Wed, 17 Jan 2001 08:30:52 +0000
Subject: Re: random no. between two numbers?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-34994@lists.php.net to get a copy of this message
At 23:24 16/01/01 -0800, Erick Papadakis wrote:
hi, in php, how can i generate a random no. but between two numbers? for example, i need to generate any integer, randomly, between 1 and 1000.
Check out the manual entry for mt_rand. (http://www.php.net/manual/en/function.mt-rand.php) e.g. you could use mt_rand(1, 1000) - note that would you need to use mt_srand first to generate the seed for mt_rand. HTH, Angus.

« previous php.general (#34994) next »