public static function getBaseUrl()
    {
        $protocol = isset($_SERVER['HTTPS']) ? 'https' : 'http';
        $url = $protocol . '://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . $_SERVER['REQUEST_URI'];

        // cut at last '/' (we dont want to see index.php)
        return substr($url, 0, strrpos($url, '/'));
    }
public static function getBaseUrl()
    {
        $protocol = isset($_SERVER['HTTPS']) ? 'https' : 'http';
        $url = $protocol . '://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . $_SERVER['REQUEST_URI'];

        // cut at last '/' (we dont want to see index.php)
        return substr($url, 0, strrpos($url, '/'));
    }
public static function getBaseUrl ( ) { $ protocol = isset ( $ _SERVER [ 'HTTPS' ] ) ? 'https' : 'http' ; $ url = $ protocol . '://' . $ _SERVER [ 'SERVER_NAME' ] . ':' . $ _SERVER [ 'SERVER_PORT' ] . $ _SERVER [ 'REQUEST_URI' ] ; // cut at last '/' (we dont want to see index.php) return substr ( $ url , 0 , strrpos ( $ url , '/' ) ) ; }
Get the url where this script is running.
This is used in samples to determine the exchange and return urls

@return string
Get the url where this script is running . This is used in samples to determine the exchange and return urls