php代码
function str_rand($length)//随机字符,参数是长度 { if(empty($length)) return NULL; $a = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz'; $rand_str = ''; for($i=0;$i<$length;++$i) { $rand_str .= $a[rand(0,61)]; } return $rand_str; }