Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php simplexml_load_file() with password protected url

Simple question for the one who knows the answer...

$xml = simplexml_load_file("http://url/path/file.xml");

This url is .htaccess protected, how can I pass the login/password as arguments to the function?

like image 286
Pierre Avatar asked Jun 02 '10 14:06

Pierre


1 Answers

$xml = simplexml_load_file("http://username:password@url/path/file.xml");

Try that :)

like image 150
Phliplip Avatar answered Sep 19 '22 12:09

Phliplip