A simple question for someone who knows the answer ...
$xml = simplexml_load_file("http://url/path/file.xml");
This url is protected .htaccess, how can I pass login / password as arguments to a function?
.htaccess
$xml = simplexml_load_file("http://username:password@url/path/file.xml");
Try it :)
file_get_contentsor curl will allow you to set user authentication using http://username:password@url/path/file.xml.
file_get_contents
http://username:password@url/path/file.xml
Take the string data and pass in simplexml_load_string.
simplexml_load_string
allow_url_fopen allow_url_include php.ini( propriertary.htaccess), . , .
.htaccess :
php_value allow_url_fopen 1 php_value allow_url_include 1
Source: https://habr.com/ru/post/1748165/More articles:Integrated SQL design, help / recommendations - sqlКак управлять номером страницы в FOP? - xsl-foПолучить информацию из высшего класса? - oopWhat is the best resource for developing Windows drivers? - windowsRun the command and now () - c #Cohan inheritance - phpIs it possible to run the Silverlight 4 OOB application from a web page? - silverlightLarge table in iFrame crashes IE8 - asp.netHow can I use Shell32.dll in Silverlight OOB - pinvokeOpen Form2 from Form1, close Form1 from Form2 - c #All Articles