 <p>What's probably happening is that your URL has escaped characters in it (%3D%3D) and your $_GET is the unescaped characters so they don't match. str_replace can work on very large strings without a problem.</p> <p>If you want to get rid of that value, just do this:</p> <pre><code>$query_params = $_GET; unset($query_params['stepvars']); $new_link = http_build_query($query_params); </code></pre> <p>That will work even if the param is the first one (?stepvars=...)</p>