I'm using the following method to generate 5 random lottery

/* srand is not important since php v>=4.2.0 */
$numbers = range (1,90);
$x = array_rand ($numbers, 5);
foreach ($x as $v) echo "{$numbers[$v]} ";

It works fine, except the first query: php may restart the random
numbers, if it is not used for some seconds. What should i do to
get rid of this problem? I want to use array_rand(), (so I don't
want to use mt_rand) because it's more nice than a complicated
selecting method...

I'm using Apache/1.3.27 (Win32) PHP/4.2.2

Thanks in advance

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to