PHP replace GET-value of a variable
<p>I have a URL as a string in <code>$url</code>.</p>

<p>I want to replace a specific parameter (if it exists) in the URL.</p>

<p>For example</p>

<pre><code>$url = "http://www.xxx.xxx?data=1234324&amp;id=abc&amp;user=walter";
</code></pre>

<p>I'd like check if <code>id</code> exists and if it does, I want to replace the value of that <code>id</code> to a specific value. But the value of the <code>id</code> isn't always the same and it's not always in the same place.</p>