php随机字符串

来源:互联网 发布:unity3d素材免费下载 编辑:程序博客网 时间:2024/05/06 14:55
class str{
 public static function quickRandom($length = 16)
    {
        $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';

        return substr(str_shuffle(str_repeat($pool, $length)), 0, $length);
    }
}

echo str::quickRandom();
0 0
原创粉丝点击