blue-twilight/app/Helpers/MiscHelper.php

19 lines
353 B
PHP
Raw Normal View History

<?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;
}
}