Jon!

> <?php
> for ($i=1; $i<=6; $i++)
>   $x[] = mt_rand(1, 90);
> foreach ($x as $current)
>   echo $current. "<br />";
> ?>

Thanks for help, but your program may generate same numbers between
the 5 generated numbers, hovewer I want to generate different numbers
such as lottery-numbers. array_rand() is a very nice solution for this
problem, other solutions with mt_rand() should be much longer. (I
should care about if this random number has generated already or not)
But if this is the only solution I'll do it in this way... (in this
case there are a lot of useless php functions, that use random numbers
adjusted to the simple srand() such as shuffle())

Tamas








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

Reply via email to