随机取6位数字或字母方法
生活随笔
收集整理的這篇文章主要介紹了
随机取6位数字或字母方法
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
$password = '';
$chars = '123456789abcdefghjkmnpqrstuvwxyz';
for($i = 0; $i < 8; $i ++) {
$password .= substr ( $chars, mt_rand ( 0, strlen ( $chars ) - 1 ), 1 );
}
$chars = '123456789abcdefghjkmnpqrstuvwxyz';
for($i = 0; $i < 8; $i ++) {
$password .= substr ( $chars, mt_rand ( 0, strlen ( $chars ) - 1 ), 1 );
}
轉載于:https://www.cnblogs.com/xlz307/p/4235817.html
總結
以上是生活随笔為你收集整理的随机取6位数字或字母方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: hdu 5072 Coprime
- 下一篇: unity3d-知识汇总