PhilippBaschke\ACFProInstaller\Plugin::removeParameterFromUrl PHP Method

removeParameterFromUrl() protected method

Removes ¶meter=value from the given url. Only works with urls that have multiple parameters and the parameter that should be removed is not the first (because of the & character).
protected removeParameterFromUrl ( string $url, string $parameter ) : string
$url string The url where the parameter should be removed
$parameter string The name of the parameter
return string The url with the ¶meter=value removed
    protected function removeParameterFromUrl($url, $parameter)
    {
        // e.g. &t=1.2.3 in example.com?p=index.php&t=1.2.3&k=key
        $pattern = "/(&{$parameter}=[^&]*)/";
        return preg_replace($pattern, '', $url);
    }