public static function getRandomString($length = '')
{
$code = md5(uniqid(rand(), true));
if ($length != '' && (int) $length > 0) {
$length = $length - 1;
return chr(rand(97, 122)) . substr($code, 0, $length);
} else {
return chr(rand(97, 122)) . $code;
}
}