WPLib::get_real_url PHP Method

get_real_url() static public method

Like realpath() but for URLs
static public get_real_url ( string $url ) : string
$url string
return string
    static function get_real_url($url)
    {
        foreach (array_keys($url = explode('/', $url), '..') as $keypos => $key) {
            array_splice($url, $key - ($keypos * 2 + 1), 2);
        }
        return str_replace('./', '', implode('/', $url));
    }