public static function getDomain()
    {
        if (HTTP_HOST != null) {
            if (preg_match('/(localhost|127\.0\.0\.1)/', HTTP_HOST)) {
                return null; // prevent problems on local setups
            }

            return preg_replace('/(^www\.|:\d+$)/i', null, HTTP_HOST);
        }

        return null;
    }
public static function getDomain()
    {
        if (HTTP_HOST != null) {
            if (preg_match('/(localhost|127\.0\.0\.1)/', HTTP_HOST)) {
                return null; // prevent problems on local setups
            }

            return preg_replace('/(^www\.|:\d+$)/i', null, HTTP_HOST);
        }

        return null;
    }
public static function getDomain ( ) { if ( HTTP_HOST != null ) { if ( preg_match ( '/(localhost|127\.0\.0\.1)/' , HTTP_HOST ) ) { return null ; // prevent problems on local setups } return preg_replace ( '/(^www\.|:\d+$)/i' , null , HTTP_HOST ) ; } return null ; }
Returns the current domain for the Session to be saved to, if the installation
is on localhost, this returns null and just allows PHP to take care of setting
the valid domain for the Session, otherwise it will return the non-www version
of the domain host.

@return string|null
Null if on localhost, or HTTP_HOST is not set, a string of the domain name sans
www otherwise
Returns the current domain for the Session to be saved to if the installation is on localhost this returns null and just allows PHP to take care of setting the valid domain for the Session otherwise it will return the non - www version of the domain host .