2023-12-26 11:16:24 +01:00
|
|
|
<?php
|
2023-12-28 12:29:52 +01:00
|
|
|
function randstr($len,$chars=null) {
|
|
|
|
if (is_null($chars))
|
|
|
|
$chars='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_:;\'"%&/?^';
|
|
|
|
$charslen=strlen($chars)-1;
|
2023-12-26 11:16:24 +01:00
|
|
|
$str='';
|
|
|
|
for ($i=0; $i<$len; $i++)
|
2023-12-28 12:29:52 +01:00
|
|
|
$str.=$chars[mt_rand(0,$charslen)];
|
2023-12-26 11:16:24 +01:00
|
|
|
return($str);
|
|
|
|
}
|
|
|
|
?>
|