我不能用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已激活。奇怪的是,这段代码可以工作:
$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);有人知道问题出在哪里吗?
发布于 2015-04-08 12:49:37
我在本地尝试这样做时也遇到了同样的问题,代码在主机上工作。
https://stackoverflow.com/questions/29369152
复制相似问题