随机取6位数字或字母方法

$password = '';
$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