回复讨论(解决方案) /**
* 生成随机数
* @param int $length ?度
* @return string
*/
function randomkey($length) {
$hash = '';
$chars = 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz1234567890';
$max = strlen($chars) - 1;
for ($i = 0; $i $hash .= $chars[mt_rand(0, $max)];
}
return $hash;
}
