php生成随机字符串
/**
* @Title: create_randomstr
* @Description: 获取随机字符串
* @param @param number $lenth 字符长度
*/
function create_randomstr($lenth = 8) {
$str = '';
$strPol = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz";
$max = strlen($strPol)-1;
for($i=0;$i<$lenth;$i++){
$str.=$strPol[rand(0,$max)];
}
return $str;
}