note 13065 added to function.rand.php
| From: | luisfel at luisfel dot cl | Date: | Thu, 24 May 2001 17:22:16 +0000 |
| Subject: | note 13065 added to function.rand.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-14256@lists.php.net to get a copy of this message | ||
Un sistema un poco menos complicado para generar un psw (basado en los ejemplos anteriores)...:)
while ($i<7){
srand((double)microtime()*1000000);
$num=rand(0,255);
$txt=chr($num);
if (eregi("^[a-z0-9]$", $txt)) {
$psw=$psw.$txt;
$i++;
}
}
http://www.php.net/manual/en/function.rand.php