title: How to Decode the &amp; from a URL so that header() works (urldecode not working)
body: <p>I have the following URL: <code>$url = 'http://mysite.com/?p=welcome&amp;amp;x=1&amp;amp;y=2';</code></p>
  
  <p>I need to decode it so that <code>header("Location: $url");</code> actually works.</p>
  
  <p>However, using <code>urldecode($url)</code> is not working because it's <strong>not</strong> decoding the <code>&amp;amp;</code> -> <code>&amp;</code> and so the browser is getting redirected to <code>http://mysite.com/?p=welcome&amp;amp;x=1&amp;amp;y=2</code> which fails.</p>
  
  <p>I need it to decode so that it looks like:  <code>http://mysite.com/?p=welcome&amp;x=1&amp;y=2</code></p>
  
  <p>How do I do that?</p>