【发布时间】:2011-09-17 23:24:38
【问题描述】:
我真的不明白如何在 PHP 中使用 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>
我需要检索这个: 来源、时间戳、主题、操作、消息
我只是不明白。有人可以帮我解决这个问题吗?
【问题讨论】:
-
问题就是问题,答案就是答案。我将您的编辑移到下面的答案中:stackoverflow.com/a/14194288/367456 - 如果您愿意,您也可以这样做(通过访问您的问题的历史记录),然后我将删除我的副本。
标签: php attributes simplexml