src/SpamBlocker.php
private function getRootDomain($domain)
    {
        $domainParts = explode('.', $domain);
        $count       = count($domainParts);

        return $count > 1
            ? $domainParts[$count - 2].'.'.$domainParts[$count - 1]
            : $domainParts[0];
    }
private function getRootDomain($domain)
    {
        $domainParts = explode('.', $domain);
        $count       = count($domainParts);

        return $count > 1
            ? $domainParts[$count - 2].'.'.$domainParts[$count - 1]
            : $domainParts[0];
    }
private function getRootDomain ( $ domain ) { $ domainParts = explode ( '.' , $ domain ) ; $ count = count ( $ domainParts ) ; return $ count > 1 ? $ domainParts [ $ count - 2 ] . '.' . $ domainParts [ $ count - 1 ] : $ domainParts [ 0 ] ; }
Get the root domain.

@param  string  $domain

@return string
Get the root domain .