public static function IsValidUsername($username)
{
$letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
if (strlen($username) < 3 || strlen($username) > 15)
{
return false;
}
if (strpos($username, " ") !== false)
{
return false;
}
if (! in_array($username[0], $letters))
{
return false;
}
if (!preg_match("/^[a-zA-Z\d-_.]+$", $username))