12 行
241 B
PHP
12 行
241 B
PHP
<?php
|
|
|
|
function randstr($len) {
|
|
$chars='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_:;\'"%&/?^';
|
|
$charslen=strlen($chars);
|
|
$str='';
|
|
for ($i=0; $i<$len; $i++)
|
|
$str.=$chars[rand(0,$charslen-1)];
|
|
return($str);
|
|
}
|
|
|
|
?>
|