标签:substr func for turn strlen 生成 length bcd and
function createNonceStr($length = 30) {
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
$str = "";
for ($i = 0; $i < $length; $i++) {
$str .= substr($chars, mt_rand(0, strlen($chars) - 1), 1);
}
return $str;
}
标签:substr func for turn strlen 生成 length bcd and
原文地址:https://www.cnblogs.com/zwvs/p/12530649.html