title: Encoding $_GET variable URL ignores ampersand "&" character
body: <p>So im trying to get an url from the address bar that looks like this:</p>
  
  <pre><code>http://mysite.com/url.php?name=http://test.com/format.jsp?id=738ths3&amp;secure=false
  </code></pre>
  
  <p>I'm using the $_GET variable to read it right off the URL my code is as follows</p>
  
  <pre><code>$arc = rawurlencode($_GET['name']);
  echo "URL: $arc";
  </code></pre>
  
  <p>This only returns</p>
  
  <pre><code>URL: http://imgur.com/format.jsp?id=738ths3
  </code></pre>
  
  <p>It 's missing the &amp;secure=false</p>
  
  <p>What i want it to look:</p>
  
  <pre><code> URL: http://test.com/format.jsp?id=738ths3&amp;secure=false
  </code></pre>
  
  <p>I have tried urlencode, rawurlencode with no avail, i have looked in google a number of forums and stackoverflow none of the answer help, any ideas? Thanks!</p>
  
  <p>urlencode shows this:</p>
  
  <p>URL: http%3A%2F%2Ftest.com</p>
  
  <p>so i cant have that either!</p>