PHP生成随机密码的函数

function random_password($len = 7, $mixed_case = false){
        $a = "abcdefghjkmnpqrstuvwxyzABCDEFGHJKMNPQRSTUVWXYZ23456789";
        if(!$mixed_case) $a = strtolower($a)
        $out = "";
        for($i = 0; $i < $len; $i++)
                $out .= $a[mt_rand(0, strlen($a))];
        return $out;
}
除非注明, 风波竹林 文章均为原创,转载请以链接形式标明本文地址
本文地址: https://blog.fbzl.org/php生成随机密码的函数/