title: PHP Get XML from Remote URL with HTTP Authentication
body: <p>I have a URL which gives an xml output. It requires a username and password which I can access through a browser using the format: </p>
  
  <blockquote>
    <p><a href="http://username:password@url.com" rel="nofollow">http://username:password@url.com</a></p>
  </blockquote>
  
  <p>However when I try to access it through a php file I get a 403 forbidden: </p>
  
  <pre><code>$url = "http://username:password@url.com";
  
  
  $xml = @simplexml_load_file($url);
  print_r($http_response_header);
  </code></pre>
  
  <p>I have tried using curl and setting the user agent to a browser but this still doesn't echo the data.</p>
  
  <p>EDIT:</p>
  
  <p>I also tried using pear's http request 2, which also gives a 403 forbidden</p>