Re: Random number
| From: | Hugh Bothwell | Date: | Thu, 30 Aug 2001 14:30:03 +0000 |
| Subject: | Re: Random number | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-65288@lists.php.net to get a copy of this message | ||
"Rosen" <rosen_dm@dir.bg> wrote in message
news:20010830144831.34808.qmail@pb1.pair.com...
> Hi,
> I'm using PHP code from manual:
> srand( (double) microtime() * 1000000);
> // Get random User ID
> $uid=rand();
>
> but it dowsn't work !
... I would make sure that microtime() is doing what you think it is;
something like
for ($i = 0; $i < 100; $i++) {
$k = (int) microtime();
echo "<br>$k";
for ($j = 0; $j < 10000; $j++)
$m = $j *3;
}
If you get a page of '0 / 0 / 0' you'll know what your problem is...