note 15891 added to function.srand
| From: | php_public at macfreek dot nl | Date: | Sun, 07 Oct 2001 12:52:47 +0000 |
| Subject: | note 15891 added to function.srand | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-18657@lists.php.net to get a copy of this message | ||
The make_seed() function in the example code is VERY bad, and is in fact responsible for seeding
always the same value, so that the output of rand() is the same with every page reload (!)
ALWAYS use:
(double)microtime()*1000000
See for more details my note on the mt_srand() page [ function.mt_srand.php ]
--
http://www.php.net/manual/en/function.srand.php
http://master.php.net/manage/user-notes.php?action=edit+15891
http://master.php.net/manage/user-notes.php?action=delete+15891
http://master.php.net/manage/user-notes.php?action=reject+15891