PHP getDocNamespaces() 函数
定义和用法
getDocNamespaces() 函数从 SimpleXMLElement 对象返回在 XML 文档中声明的命名空间。
如果成功,该函数返回包含命名空间名称(带有关联的 URL)的数组。如果失败,则返回 false。
语法
class SimpleXMLElement { string getDocNamespaces(recursive) }
参数 | 描述 |
---|---|
recursive | 可选。规定是否返回父子节点中的所有命名空间。默认是 false。 |
例子
XML 文件:
George John Reminder Dont forget the meeting!
PHP 代码:
getDocNamespaces()); ?>
输出类似:
Array ( [b] => http://www.w3school.com.cn/example/ )
© 版权声明
THE END
暂无评论内容