如何解析 “ID”,从以下事件PHP的XML simple_load ID
<event id="100990">
<title>myTitle</title>
</event>
我分析标题是这样的:
$xml->event[0]->title
如何解析 “ID”,从以下事件PHP的XML simple_load ID
<event id="100990">
<title>myTitle</title>
</event>
我分析标题是这样的:
$xml->event[0]->title
你access attributes就像你会访问一个关联数组的元素:
$xml_node['id'] // The value of the attribute `id` of the node `$xml_node`
返回的值是一个对象(使用__toString
方法),因此您可能需要对返回的值进行类型转换。