src/Utility.php
private static function domain(string $url): ?string
    {
        $domain = parse_url($url, PHP_URL_HOST);

        if (null !== $domain) {
            return implode('.', array_slice(explode('.', $domain), -2));
        }

        return null;
    }
private static function domain(string $url): ?string
    {
        $domain = parse_url($url, PHP_URL_HOST);

        if (null !== $domain) {
            return implode('.', array_slice(explode('.', $domain), -2));
        }

        return null;
    }
private static function domain ( string $ url ) : ? string { $ domain = parse_url ( $ url , PHP_URL_HOST ) ; if ( null !== $ domain ) { return implode ( '.' , array_slice ( explode ( '.' , $ domain ) , - 2 ) ) ; } return null ; }
Returns the domain name from URL.

@param string $url
@return null|string
Returns the domain name from URL .