Hi Tamas,

> /* 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. 

I'm not sure how to solve this, but I'm curious as to why you don't want to
use mt_rand:

<?php

for ($i=1; $i<=6; $i++) 
  $x[] = mt_rand(1, 90);

foreach ($x as $current) 
  echo $current. "<br />";

?>

You still get an array at the end of it, which seems to be what you're
after.

Cheers
Jon


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

Reply via email to