2014-01-19 47 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。 –