This is an error 404
There are `0` results
preferences:
136.36 ms | 1390 KiB | 7 Q<?php
function passwordCreate ($length = 8, $mode = '12345')
{
$small = 'abcdefghijklmnopqrstuvwxyz';
$large = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
$numeric = '0123456789';
switch ($mode) {
// 小文字英字
case 'small':
$chars = $small;
break;
// 大文字英字
case 'large':
$chars = $large;
break;
// 小文字英数字
case 'smallalnum':
$chars = $small . $numeric;
break;
// 大文字英数字
case 'largealnum':
$chars = $large . $numeric;
break;
// 数字
case 'num':
$chars = $numeric;
break;
// 大小文字英字
case 'alphabet':
$chars = $small . $large;
break;
// 大小文字英数字
case 'alnum':
default:
$chars = $small . $large . $numeric;
break;
}
$charsLength = strlen($chars);
$password = '';
for ($i = 0; $i < $length; ++$i) {
$num = mt_rand(0, $charsLength - 1);
$password .= $chars{$num};
}
return $password;
}