MENU

php生成随机字符串

January 22, 2020 • php

function randStr($num)
{
    $str = str_shuffle('abcedfghjkmnpqrstuvwxyzABCEDFGHJKMNPQRSTUVWXYZ123456789');
    return substr($str, 0, $num);//num指定多少位
}
转载请注明出处,并添加原文地址

Archives QR Code Tip
QR Code for this page
Tipping QR Code