function Make_password ($length = 8)
{
//password character set, you can add any character you need
$chars = Array (' A ', ' B ', ' C ', ' d ', ' e ', ' f ', ' G '), ' H ',
' I ', ' j ', ' K ', ' l ', ' m ', ' n ', ' o ', ' P ', ' Q ', ' R ', ' s ',
' t ', ' u ', ' V ', ' w ', ' x ', ' y ', ' z ', ' A ', ' B ', ' C ', ' D ', c6/> ' E ', ' F ', ' G ', ' H ', ' I ', ' J ', ' K ', ' L ', ' M ', ' N ', ' O ', '
P ', ' Q ', ' R ', ' S ', ' T ', ' U ', ' V ', ' W ', ' X ', ' Y ', ' Z ', '
0 ', ' 1 ', ' 2 ', ' 3 ', ' 4 ', ' 5 ', ' 6 ', ' 7 ', ' 8 ', ' 9 ', '! ',
' @ ', ' # ', ' $ ', '% ', ' ^ ', ' & ', ' * ', ' (', ') ', '-', ' _ ',
' [ ', '] ', ' {', '} ', ' < ', ' > ', ' ~ ', ' ', ' + ', ' = ', ', ', ', ', ', ', ', ', ', '
., ' | ');
$length array element key
$keys = Array_rand ($chars, $length) are randomly taken in the $chars;
$password = ';
for ($i = 0; $i < $length; $i + +)
{//phpfensi.com
//Connect $length array elements to string
$password. = $chars [$keys [$i]] ;
}
return $password;
}