Traversing XML in PHP

痞子三分冷 提交于 2019-12-03 22:11:45

In SimpleXML you can use the children('prefix', true) and attributes('prefix', true) functions to access namespaced content.

entry->content->children('m', true)->properties

or to access d:NEW_DATE

entry->content->children('m', true)->properties->children('d', true)->NEW_DATE

or one step further to access the m:type attribute

entry->content->children('m', true)->properties->children('d', true)->NEW_DATE->attributes('m', true)->type

You can use the SimpleXml's functions SimpleXML

But my fav class is DOMDocument

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!