note 17198 added to function.rand
| From: | php-general at lists dot php dot net | Date: | Thu, 29 Nov 2001 15:05:43 +0000 |
| Subject: | note 17198 added to function.rand | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-21429@lists.php.net to get a copy of this message | ||
To make a password based on random U/L-chars and digits, one might use this :
<?php
mt_srand ((double) microtime() * 1000000);
$string = md5(microtime());
$password = substr($string, 0, 8);
?>
Which would give random passwords with 8 chars. =8-)
--
http://www.php.net/manual/en/function.rand.php
http://master.php.net/manage/user-notes.php?action=edit+17198
http://master.php.net/manage/user-notes.php?action=delete+17198
http://master.php.net/manage/user-notes.php?action=reject+17198