<?php
function rand_str($length){
$str_pool = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz';
$max = strlen($str_pool) - 1;
$rand_str = '';
for($i=0; $i<$length; $i++){
$rand_str .= $str_pool[rand(0, $max)];
}
return $rand_str;
}
echo rand_str(10);
?>
007.PHP生成随机字符串
最新推荐文章于 2024-07-30 21:02:40 发布