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:
http://username:pa
The format -- http://username:password@url.com -- is a convention the browser understands; but if you're making an HTTP request programmatically, you'll need to set the HTTP Headers for basic authentication. I don't think *simplexml_load_file* supports HTTP headers, but you could try using for example:
fopen("http://$username:$password@url.com");