public static function getUrl()
    {
        static $uri = null;

        if (null === $uri) {
            $uri = (true === isset($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : '';

            if (strlen($uri) > 0) {
                $uri = ((true === is_ssl()) ? 'https://' : 'http://') . $uri;
            }

            if (true === isset($_SERVER['SERVER_PORT'])) {
                if ($_SERVER['SERVER_PORT'] !== '80' && $_SERVER['SERVER_PORT'] !== '443') {
                    $uri .= ':'.$_SERVER['SERVER_PORT'];
                }
            }

            $uri .= $_SERVER['REQUEST_URI'];
        }

        return $uri;
    }
public static function getUrl()
    {
        static $uri = null;

        if (null === $uri) {
            $uri = (true === isset($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : '';

            if (strlen($uri) > 0) {
                $uri = ((true === is_ssl()) ? 'https://' : 'http://') . $uri;
            }

            if (true === isset($_SERVER['SERVER_PORT'])) {
                if ($_SERVER['SERVER_PORT'] !== '80' && $_SERVER['SERVER_PORT'] !== '443') {
                    $uri .= ':'.$_SERVER['SERVER_PORT'];
                }
            }

            $uri .= $_SERVER['REQUEST_URI'];
        }

        return $uri;
    }
public static function getUrl ( ) { static $ uri = null ; if ( null === $ uri ) { $ uri = ( true === isset ( $ _SERVER [ 'SERVER_NAME' ] ) ) ? $ _SERVER [ 'SERVER_NAME' ] : '' ; if ( strlen ( $ uri ) > 0 ) { $ uri = ( ( true === is_ssl ( ) ) ? 'https://' : 'http://' ) . $ uri ; } if ( true === isset ( $ _SERVER [ 'SERVER_PORT' ] ) ) { if ( $ _SERVER [ 'SERVER_PORT' ] !== '80' && $ _SERVER [ 'SERVER_PORT' ] !== '443' ) { $ uri .= ':' . $ _SERVER [ 'SERVER_PORT' ] ; } } $ uri .= $ _SERVER [ 'REQUEST_URI' ] ; } return $ uri ; }
Returns the current URL used for request.

@author Benjamin Carl <opensource@clickalicious.de>
@return string|null TRUE if header could be send, otherwise FALSE
@access public
@link http://stackoverflow.com/questions/176264/what-is-the-difference-between-a-uri-a-url-and-a-urn
@static
Returns the current URL used for request .