adding create_pass function

This commit is contained in:
Steven Mondji-Lerider 2012-08-24 10:31:57 +00:00
parent cffff987db
commit 7d47f685e1
1 changed files with 13 additions and 0 deletions

View File

@ -578,6 +578,19 @@ function pager($offset,$count,$total,$url,$before="",$after="") {
echo $after;
}
function create_pass($length = 8){
$chars = "1234567890abcdefghijkmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
$i = 0;
$password = "";
while ($i <= $length) {
$password .= @$chars{mt_rand(0,strlen($chars))};
$i++;
}
return $password;
}
?>