美文网首页
随机生成 六位 字母加数字

随机生成 六位 字母加数字

作者: Omit03 | 来源:发表于2016-11-24 08:36 被阅读0次

public  function randomkeys($length = 6) {

$returnStr='';

$pattern = '1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLOMNOPQRSTUVWXYZ';

for($i = 0; $i < $length; $i ++) {

$returnStr .= $pattern {mt_rand ( 0, 61 )}; //生成php随机数

}

var_dump($returnStr);

}

相关文章

网友评论

      本文标题:随机生成 六位 字母加数字

      本文链接:https://www.haomeiwen.com/subject/zikbpttx.html