note 103321 deleted from function.md5 by thiago
| From: | thiago@php.net | Date: | Fri, 08 Apr 2011 04:54:05 +0000 |
| Subject: | note 103321 deleted from function.md5 by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-178627@lists.php.net to get a copy of this message | ||
Note Submitter: Maximiliano Fragale
----
A very simple function to generate random passwords or random strings.
Use the length parameter to increase or decrease the result.
Thanks.
<?php
function rand_passwd($length){
$tmp=md5(mt_rand());
$tmp=substr($tmp,0,$length);
return $tmp;
}
?>