note 24562 added to function.srand
| From: | james at nowuk dot net | Date: | Wed, 21 Aug 2002 12:54:26 +0000 |
| Subject: | note 24562 added to function.srand | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-35309@lists.php.net to get a copy of this message | ||
Ok, so calling srand a second time based on a value that is likely to be similar to the first one is
a bad idea, but what about always calling it as:
srand(microtime() * rand(10000, 2000000))
If we've been called previously, the seed will be based on a presumably random value...
Can anyone who knows what they're talking about make any comment?
--
http://www.php.net/manual/en/function.srand.php
http://master.php.net/manage/user-notes.php?action=edit+24562
http://master.php.net/manage/user-notes.php?action=delete+24562
http://master.php.net/manage/user-notes.php?action=reject+24562