note 35511 rejected from function.array-rand by vincent
| From: | vincent@php.net | Date: | Sat, 06 Sep 2003 09:42:18 +0000 |
| Subject: | note 35511 rejected from function.array-rand by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-55536@lists.php.net to get a copy of this message | ||
Note Submitter: pascall@apinc.org
----
hi,
system :
WINDOWS XP
PHP4.3.3
i'm using the code below to have sme random
values from an array :
<?php
$lstchiffre=array(1,2,3,4,5,6,8,9);
$rand_keys = array_rand ($lstchiffre,1);
echo $lstchiffre[$rand_keys]."<br>";
?>
but it always send the same result 2.
if i add srand ((double) microtime() * 10000000);
it works...
i see in the documentation
that i dont' need to add that line to initialize the random...
where is the problem????
thanks
pascal