I'm using the following commands to read a remote XML file in a PHP web page:
$url = 'http://www.examplesite.com/xml';
$xml = simplexml_load_file($url);
Unfortunately, the site uses digest authentication and a username/password box normally pops up and requires me to log into the site. It does not work to embed my username and password in the URL itself (like http://USER:PASSWORD@examplesite.com/), nor is this very secure.
How do I authenticate (in PHP) to get the XML file?