Implement the code, copy and use:
header("Content-type:text/html;charset=utf-8");
function getRandPass($length = 6){
$password = '';
//Add the characters you want to the string below, the default is numbers 0-9 and 26 English letters
$chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ";
$char_len = strlen($chars);
for($i=0;$i<$length;$i++){
$loop = mt_rand(0, ($char_len-1) );
//Treat this string as an array, randomly pick out a character, and loop into the number of digits you need
$password .= $chars[$loop];
}
return $password;
}
echo getRandPass(12); //Randomly generate a 12-digit password
?>