日期:2014-05-17 浏览次数:20439 次
<?php
function getRandStr($len){
$chars = array("0", "1", "2","3", "4", "5", "6", "7", "8", "9"); //换成a-z,A-Z 52种
$charsLen = count($chars) - 1;
shuffle($chars);
$output = "";
for ($i=0; $i<$len; $i++){
$output .= $chars[mt_rand(0, $charsLen)];
}
return $output;
}
?>