diff options
Diffstat (limited to 'inc/functions.php')
| -rw-r--r-- | inc/functions.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/inc/functions.php b/inc/functions.php index 12bf2fc..92343f7 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -84,4 +84,15 @@ function bulletin_mail ($to, $subject, $body) { return 0; } } + +function pwgen ($len) { + $alpha = 'abcdefghijklmnopqrstuvwxyz'; + $alpha .= strtoupper($alpha); + $alpha .= '0123456789'; + $pass = ''; + $alen = strlen($alpha); + for ($i = 0; $i < $len; $i++) + $pass .= $alpha[mt_rand(0, $alen-1)]; + return $pass; +} ?> |
