随机密码

来源:互联网 发布:哪个不是淘宝禁售商品 编辑:程序博客网 时间:2024/05/24 04:48
/**     * 生成随机密码     * @author Leven <xp.develop@outlook.com>     * @return string     */    function createRegPwd()    {        $str = '';        $strPol = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz";        $max = strlen($strPol) - 1;        for ($i = 0; $i < 8; $i ++) {            $str .= $strPol{rand(0, $max)};        }        return $str;    }

原创粉丝点击