title: Basic authentication when loading feed with DOMDocument
body: <p>I have a php code which retrieves a atom feed in a DOMDocument (the feed is not saved to file)</p>
  
  <p>I need to start using basic authentication for retrieving the feed.</p>
  
  <p>Is it possible, or do I have to save the feed to file first?</p>
  
  <p>My working code:</p>
  
  <pre><code>$doc = new DOMDocument();
  $doc-&gt;load($feedurl);
  $feed = $doc-&gt;getElementsByTagName("entry");
  </code></pre>
  
  <p>I have tried this:</p>
  
  <pre><code>$context = stream_context_create(array(
      'http' =&gt; array(
          'header'  =&gt; "Authorization: Basic " . base64_encode("$username:$password")
      )
  ));
  
  
  $doc = new DOMDocument();
  $doc-&gt;load($feedurl, context);
  $feed = $doc-&gt;getElementsByTagName("entry");
  </code></pre>
  
  <p>But it does not work (I get a empty <code>$doc</code>) </p>
  
  <p>Anyone know how to do this?</p>