public static function username($x)
	{
		// Does it contain invalid characters?
		if (!preg_match("/^[0-9a-z]+[_0-9a-z]*$/", $x))
		{
			return false;
		}

		// Is it a positive integer?
		if (self::nonNegativeInteger($x))
		{
			return false;
		}

		// Is it a reserved username?
		if (self::reserved('username', $x))
		{
			return false;
		}

		return true;
	}
public static function username($x)
	{
		// Does it contain invalid characters?
		if (!preg_match("/^[0-9a-z]+[_0-9a-z]*$/", $x))
		{
			return false;
		}

		// Is it a positive integer?
		if (self::nonNegativeInteger($x))
		{
			return false;
		}

		// Is it a reserved username?
		if (self::reserved('username', $x))
		{
			return false;
		}

		return true;
	}
public static function username ( $ x ) { // Does it contain invalid characters? if ( ! preg_match ( "/^[0-9a-z]+[_0-9a-z]*$/" , $ x ) ) { return false ; } // Is it a positive integer? if ( self :: nonNegativeInteger ( $ x ) ) { return false ; } // Is it a reserved username? if ( self :: reserved ( 'username' , $ x ) ) { return false ; } return true ; }
Check if a username is valid.

- Check if the username contains any invalid characters
- Check if username is just an integer
- Check if the username is reserved

@param   string   $x  Username to check
@return  boolean  True if valid, false if invalid
Check if a username is valid .