note 16755 added to function.mt-srand
| From: | l_rossato at libero dot it | Date: | Mon, 12 Nov 2001 13:47:23 +0000 |
| Subject: | note 16755 added to function.mt-srand | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-20753@lists.php.net to get a copy of this message | ||
Try this much simpler approach:
list($usec,$sec)=explode(" ",microtime());
mt_srand($sec * $usec);
This won't cause an overflow during the float-to-integer conversion.
Of course, if you only need ONE random number just take $sec * $usec! Otherwise, call mt_srand just
once at the start of your program.
--
http://www.php.net/manual/en/function.mt-srand.php
http://master.php.net/manage/user-notes.php?action=edit+16755
http://master.php.net/manage/user-notes.php?action=delete+16755
http://master.php.net/manage/user-notes.php?action=reject+16755