Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 每天将外部托管和密码保护的xml文件下载到我们的Web服务器-http_Php_Xml_Http - Fatal编程技术网

Php 每天将外部托管和密码保护的xml文件下载到我们的Web服务器-http

Php 每天将外部托管和密码保护的xml文件下载到我们的Web服务器-http,php,xml,http,Php,Xml,Http,这与下面的问题基本相同,但在我们的例子中,源代码受密码保护(用户名和密码) 这可以通过http实现吗 如何对这些东西进行编码?需要什么类型的身份验证?如果使用Apache进行基本身份验证,则可以通过以下方式写入URL自动登录: 简单的php示例: <?php $content = file_get_contents('http://user:password@host.com/file.xml'); ?>

这与下面的问题基本相同,但在我们的例子中,源代码受密码保护(用户名和密码)

这可以通过http实现吗


如何对这些东西进行编码?

需要什么类型的身份验证?如果使用Apache进行基本身份验证,则可以通过以下方式写入URL自动登录:

简单的php示例:

<?php 
$content = file_get_contents('http://user:password@host.com/file.xml');
?>