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