Copy CodeThe code is as follows:
/**************
* @length-length of random string (must be a multiple of 2)
**************/
function readable_random_string ($length = 6) {
$conso =array ("B", "C", "D", "F", "G", "H", "J", "K", "L",
"M", "N", "P", "R", "s", "T", "V", "w", "X", "Y", "z");
$vocal =array ("A", "E", "I", "O", "U");
$password = "";
Srand (Double) microtime () *1000000);
$max = $length/2;
for ($i =1; $i <= $max; $i + +)
{
$password. = $conso [Rand (0,19)];
$password. = $vocal [Rand (0,4)];
}
return $password;
}
This is an article released before the home of the script. More tips can be used for reference.
21 useful and convenient PHP function codes collected
http://www.bkjia.com/PHPjc/322046.html www.bkjia.com true http://www.bkjia.com/PHPjc/322046.html techarticle Copy the code code as follows:/************** * @length-length of random string (must be a multiple of 2) **************/function Reada Ble_random_string ($length = 6) {$conso =array (" ...