PHP 简易版生成随机码

<?php

function makeRandomCount($length = 6){
$key = “”;
$str = ’0123456789ABCDEFGHIJKLOMNOPQRSTUVWXYZ’;//字符池
for($i=0;$i<$length;$i++) {
$key .= $str{mt_rand(0,36)};
}
return $key;
}

?>
posted @ 2011-10-10 12:04  潺莪  阅读(122)  评论(0)    收藏  举报