簡體   English   中英

SimpleXML-simplexml_load_file()

[英]SimpleXML - simplexml_load_file()

我無法使用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);

有人知道問題出在哪里嗎?

嘗試在本地執行此操作時遇到了同樣的問題,代碼可以在主機上找到。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM