function getRandChar($length) { $str = null; $strPol = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz"; $max = strlen($strPol) - 1; for ($i = 0;$i < $length;$i++) { $str .= $strPol[rand(0, $max)]; } return $str; }
PHP好用的生成随机字符串 长度自定义
最新推荐文章于 2023-11-09 19:08:47 发布