【发布时间】:2012-08-17 02:16:00
【问题描述】:
function retrieveProfile()
{
$url = "http://steamcommunity.com/profiles/{$this->steamID64}/?xml=1";
$profileData = simplexml_load_string($url);
if(!empty($profileData->error)) { return NULL; }
$this->friendlyName = (string) $profileData->steamID;
}
警告:simplexml_load_string() [function.simplexml-load-string]:实体:第 1 行:解析器错误:需要开始标记,未找到“
警告:simplexml_load_string() [function.simplexml-load-string]:http://steamcommunity.com/profiles/76561197991676121/?xml=1
警告:simplexml_load_string() [function.simplexml-load-string]:^
这是 XML 文件:
http://steamcommunity.com/profiles/76561197991676121/?xml=1
我不知道为什么它不起作用,是的,它有 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> 标题!
也试过$profileData = new SimpleXMLElement(file_get_contents($url)),但我得到了相同的结果。
为什么会这样?我该如何解决?我正在搜索 3 个小时,但只看到对我没有帮助的答案。
错误:http://img824.imageshack.us/img824/9464/errorszz.png
EDIT1:simplexml_load_string 是我的错误之一,但现在我遇到了更多关于 simplexml_load_file 的错误 - 告诉我文档是空的...(不是真的!)
【问题讨论】: