function random_password length itog data array array array array arra

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
function random_password($length) {
$itog = "";
$data = array(
array ('m','n','b','v','c','x','z','l','k','j','h','g','f','d','s','a','p','o','i','u','y','t','r','e','w','q'),
array ('Q','W','E','R','T','Y','U','I','O','P','A','S','D','F','G','H','J','K','L','Z','X','C','V','B','N','M'),
array ('0','9','8','7','6','5','4','3','2','1'),
array ('@', '#', '$', '%', '&', '(', ')', '=', '+', '~')
);
for ($i=0; $i<$length; $i++) {
$level1 = mt_rand(0, 3);
$itog .= $data[$level1][array_rand($data[$level1])];
}
return $itog;
}