联系我们:416326801#qq.com(#改成@)

img1

PHP生成一个随机数

786 Views 标签: PHP

//随机数
public static function getNonceStr($length = 32) {
    $chars = "abcdefghijklmnopqrstuvwxyz0123456789";
    $str = "";
    for ( $i = 0; $i < $length; $i++ ) {
        $str .= substr($chars, mt_rand(0, strlen($chars) - 1), 1);
    }
    return $str;
}

如果觉得我的文章对您有用,打赏一下呗.

wxpay.png