自动生成验证码,前两位字母,后六位数字
$length= 8;
$chars1 = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$chars2 = '0123456789';
$max1 = strlen($chars1) - 1;
$max2 = strlen($chars2) - 1;
??????? mt_srand((double)microtime() * 1000000);
??????? for($i = 0; $i < 2; $i++) {
??????????? $card .= $chars1[mt_rand(0, $max1)];
???????? }
for($i = 0; $i < 6; $i++){
??? $card .= $chars2[mt_rand(0, $max2)];
}
?