public static function getDomain($url = false)
    {
        if ($url) {
            preg_match('/([\w]+[.]){1,}[a-z]+/', $url, $matches);

            return isset($matches[0]) ? $matches[0] : false;
        }

        return $_SERVER['SERVER_NAME'];
    }