简体   繁体   中英

SimpleXML - simplexml_load_file()

I can't load a XML file with SimpleXML. I am always trying the function simplexml_load_file, but it doesn't work. Here is my PHP-Code:

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

Output: Failure

I also looked in the php.ini and allow_url_fopen is activated. Bizzarely, this code works:

$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);

Does anyone know what the problem is?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM