php中的字符串可以当做数组调用
eg:
<?php
$str1="abcdefghijklmnopqrstuvwxyz";
$str1=strtoupper($str1);
$str=$str1."1234567890";
$max=strlen($str);
$new="";
for($i=0;$i<4;$i++)
{
$new.=$str[rand(0,$max-1)];
}
echo $new;
?>
这也是生成随机字符的代码。