public static function get_currentUrl($filter = array(), $queryFilter = array(), $queryFilterMethod = 'remove')
    {
        if (!is_array($filter) && !empty($filter)) {
            $filter = array($filter);
        }

        if (!empty(self::$fakeCurrentUrl)) {
            $pageURL = self::$fakeCurrentUrl;
        } else {
            $pageURL = self::get_realCurrentUrl();
        }

        if (empty($filter) && empty($queryFilter)) {
            return $pageURL;
        }

        if (empty($filter)) {
            $filter = array('http', 'name', 'port', 'path', 'request');
        }

        $urlParts = parse_url($pageURL);

        if (!in_array('http', $filter)) {
            $pageURL = preg_replace('#.*://#', '', $pageURL);
        }

        if (!in_array('name', $filter) && !in_array('host', $filter) && array_key_exists('host', $urlParts)) {
            $pageURL = str_replace($urlParts['host'], '', $pageURL);
        }

        if (!in_array('port', $filter) && array_key_exists('port', $urlParts)) {
            $pageURL = str_replace(':'.$urlParts['port'], '', $pageURL);
        }
        
        if (!in_array('path', $filter) && array_key_exists('path', $urlParts)) {
            $pageURL = str_replace($urlParts['path'], '', $pageURL);
        }

        if ((in_array('request', $filter) || in_array('query', $filter)) && array_key_exists('query', $urlParts)) {
            if (!empty($queryFilter) && is_array($queryFilter)) {
                parse_str($urlParts['query'], $query);
                

                self::filter_data($query, $queryFilter, $queryFilterMethod);

                $pageURL = explode('?', $pageURL);

                if (empty($query)) {
                    unset($pageURL[1]);
                } else {
                    $pageURL[1] = http_build_query($query);
                }

                $pageURL = implode('?', $pageURL);
            }
        } else {
            $pageURL = preg_replace('/\?.*/', '', $pageURL);
        }

        return $pageURL;
    }
public static function get_currentUrl($filter = array(), $queryFilter = array(), $queryFilterMethod = 'remove')
    {
        if (!is_array($filter) && !empty($filter)) {
            $filter = array($filter);
        }

        if (!empty(self::$fakeCurrentUrl)) {
            $pageURL = self::$fakeCurrentUrl;
        } else {
            $pageURL = self::get_realCurrentUrl();
        }

        if (empty($filter) && empty($queryFilter)) {
            return $pageURL;
        }

        if (empty($filter)) {
            $filter = array('http', 'name', 'port', 'path', 'request');
        }

        $urlParts = parse_url($pageURL);

        if (!in_array('http', $filter)) {
            $pageURL = preg_replace('#.*://#', '', $pageURL);
        }

        if (!in_array('name', $filter) && !in_array('host', $filter) && array_key_exists('host', $urlParts)) {
            $pageURL = str_replace($urlParts['host'], '', $pageURL);
        }

        if (!in_array('port', $filter) && array_key_exists('port', $urlParts)) {
            $pageURL = str_replace(':'.$urlParts['port'], '', $pageURL);
        }
        
        if (!in_array('path', $filter) && array_key_exists('path', $urlParts)) {
            $pageURL = str_replace($urlParts['path'], '', $pageURL);
        }

        if ((in_array('request', $filter) || in_array('query', $filter)) && array_key_exists('query', $urlParts)) {
            if (!empty($queryFilter) && is_array($queryFilter)) {
                parse_str($urlParts['query'], $query);
                

                self::filter_data($query, $queryFilter, $queryFilterMethod);

                $pageURL = explode('?', $pageURL);

                if (empty($query)) {
                    unset($pageURL[1]);
                } else {
                    $pageURL[1] = http_build_query($query);
                }

                $pageURL = implode('?', $pageURL);
            }
        } else {
            $pageURL = preg_replace('/\?.*/', '', $pageURL);
        }

        return $pageURL;
    }
public static function get_currentUrl ( $ filter = array ( ) , $ queryFilter = array ( ) , $ queryFilterMethod = 'remove' ) { if ( ! is_array ( $ filter ) && ! empty ( $ filter ) ) { $ filter = array ( $ filter ) ; } if ( ! empty ( self :: $ fakeCurrentUrl ) ) { $ pageURL = self :: $ fakeCurrentUrl ; } else { $ pageURL = self :: get_realCurrentUrl ( ) ; } if ( empty ( $ filter ) && empty ( $ queryFilter ) ) { return $ pageURL ; } if ( empty ( $ filter ) ) { $ filter = array ( 'http' , 'name' , 'port' , 'path' , 'request' ) ; } $ urlParts = parse_url ( $ pageURL ) ; if ( ! in_array ( 'http' , $ filter ) ) { $ pageURL = preg_replace ( '#.*://#' , '' , $ pageURL ) ; } if ( ! in_array ( 'name' , $ filter ) && ! in_array ( 'host' , $ filter ) && array_key_exists ( 'host' , $ urlParts ) ) { $ pageURL = str_replace ( $ urlParts [ 'host' ] , '' , $ pageURL ) ; } if ( ! in_array ( 'port' , $ filter ) && array_key_exists ( 'port' , $ urlParts ) ) { $ pageURL = str_replace ( ':' . $ urlParts [ 'port' ] , '' , $ pageURL ) ; } if ( ! in_array ( 'path' , $ filter ) && array_key_exists ( 'path' , $ urlParts ) ) { $ pageURL = str_replace ( $ urlParts [ 'path' ] , '' , $ pageURL ) ; } if ( ( in_array ( 'request' , $ filter ) || in_array ( 'query' , $ filter ) ) && array_key_exists ( 'query' , $ urlParts ) ) { if ( ! empty ( $ queryFilter ) && is_array ( $ queryFilter ) ) { parse_str ( $ urlParts [ 'query' ] , $ query ) ; self :: filter_data ( $ query , $ queryFilter , $ queryFilterMethod ) ; $ pageURL = explode ( '?' , $ pageURL ) ; if ( empty ( $ query ) ) { unset ( $ pageURL [ 1 ] ) ; } else { $ pageURL [ 1 ] = http_build_query ( $ query ) ; } $ pageURL = implode ( '?' , $ pageURL ) ; } } else { $ pageURL = preg_replace ( '/\?.*/' , '' , $ pageURL ) ; } return $ pageURL ; }
curPageURL returns the current url

@param string|array $filter part or parts of the url structure that should be ignored.

@return string the current URL
curPageURL returns the current url