localhost geht hop-fly nicht

This commit is contained in:
2022-12-19 22:07:54 +01:00
parent bac04885b0
commit 3657ddf4ae
16 changed files with 301 additions and 28 deletions

View File

@ -0,0 +1,26 @@
<?php
function random_str(
$length,
$keyspace = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
)
{
$str = '';
$max = mb_strlen($keyspace, '8bit') - 1;
if ($max < 1)
{
throw new Exception('$keyspace must be at least two characters long');
}
for ($i = 0; $i < $length; ++$i)
{
$str .= $keyspace[random_int(0, $max)];
}
return $str;
}
echo random_str(20);
?>