19 lines
353 B
PHP
19 lines
353 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Helpers;
|
||
|
|
||
|
class MiscHelper
|
||
|
{
|
||
|
public static function randomString($length = 10)
|
||
|
{
|
||
|
$seed = 'abcdefghijklmnopqrstuvwxyz01234567890';
|
||
|
$string = '';
|
||
|
|
||
|
while (strlen($string) < $length)
|
||
|
{
|
||
|
$string .= substr($seed, rand(0, strlen($seed) - 1), 1);
|
||
|
}
|
||
|
|
||
|
return $string;
|
||
|
}
|
||
|
}
|