PHP Class Nabble\SemaltBlocker\Domainparser

显示文件 Open project: nabble/semalt-blocker Class Usage Examples

Public Methods

Method Description
getHostname ( string $url ) : string | false
getPath ( string $url ) : string
getRootDomain ( string $url ) : false | string Extracts lower-case ASCII root domain from URL if it is available and valid, returns false otherwise.

Private Methods

Method Description
isHostInSuffixList ( false | string $host ) : boolean
parseUrl ( string $url, integer $component ) : string | false Checks an URL for validity, and punycode encode the returned component.

Method Details

getHostname() public static method

public static getHostname ( string $url ) : string | false
$url string
return string | false

getPath() public static method

public static getPath ( string $url ) : string
$url string
return string

getRootDomain() public static method

Extracts lower-case ASCII root domain from URL if it is available and valid, returns false otherwise.
public static getRootDomain ( string $url ) : false | string
$url string
return false | string