我真的不明白如何在PHP中使用SimpleXML。使用SimpleXML获取属性和值
这里是我的XML文件的为例:
<?xml version="1.0" encoding="UTF-8" ?>
<eventlog version="1.1">
<event source="Firewall" timeStamp="1308433939" type="0" deleted="0" bodyLength="218">
<subject>Network access detected</subject>
<action>Allowed</action>
<message>The program c:\xampp\apache\bin\httpd.exe attempted to connect to the Internet. The program used the protocol TCP on port 80.</message>
</event>
</eventlog>
我需要检索此: 来源,时间戳,主题,行动,信息
我只是不明白这一点。有人可以帮助我吗?
问题是问题,答案是答案。我将你的编辑移动到下面的答案:http://stackoverflow.com/a/14194288/367456 - 如果你喜欢,你可以做同样的事情(从访问你的问题的历史),我会删除我的副本。 – hakre