SimpleXML - simplexml_load_file()

时间:2015-03-31 12:53:52

标签: php simplexml

我无法使用SimpleXML加载XML文件。我总是尝试使用simplexml_load_file函数,但它不起作用。这是我的PHP代码:

$filezilla = 'G:/xampp/FileZillaFTP/FileZilla Server.xml';
$xml = simplexml_load_file($filezilla) or die ("Failure");

Output: Failure

我也查看了php.ini并激活了allow_url_fopen。 Bizzarely,这段代码有效:

$xml = simplexml_load_file('http://api.wefeelfine.org:8080/ShowFeelings?display=xml&feeling=happy&returnfields=imageid,feeling,sentence,posttime,postdate,posturl,gender,country,state,city,lat,lon&limit=0&extraimages=20');
print_r($xml);

有谁知道问题是什么?

1 个答案:

答案 0 :(得分:0)

我尝试在本地执行此操作时遇到了同样的问题,代码在主机上找到了工作。

相关问题