2014-01-19 49 views
0

我试图读取使用

load(string $filename) 

load("data.service.xml") 

和它的作品的XML文档。现在我想从一个包含GET请求的URL读取XML文档,例如

load("https://e-activist.com/ea-dataservice/data.service?service=EaCampaignInfo&token=b818e721-48c6-4cc9-acc1-9da91071e294"); 

哪个不起作用。有任何想法吗?

回答

0

原来它不支持HTTPS,它的工作原理,只有HTTP。没有道理,但事实就是这样。

1

你可以利用file_get_contents在您load

load(file_get_contents("https://e-activist.com/ea-dataservice/data.service?service=EaCampaignInfo&token=b818e721-48c6-4cc9-acc1-9da91071e294")); 

确保您有HTTPS包装。

1

尝试的功能:simplexml_load_file()

例子:

<?php 
$xml = simplexml_load_file("https://e-activist.com/ea-dataservice/data.service?service=EaCampaignInfo&token=b818e721-48c6-4cc9-acc1-9da91071e294"); 
print_r($xml); 
?> 
+0

同样的问题。它不适用于具有GET请求的URL。 –