当前位置: 首页 > 图文教程 > 网络编程 > PHP > PHP中的DOM XML函数

PHP
如何学习一个新的PHP框架
配置最新的PHP加MYSQL服务器
PHP原版HTML编码器溢出问题的解决
PHP-Javascript“返回上一页”无缓存问题
基于DB2及PHP的应用系统跨平台迁移详细步骤(一)
基于DB2及PHP的应用系统跨平台迁移详细步骤(二)
PHP Squid中可缓存的动态网页设计
PHP读取文件夹内有多少个文件
PHP Header用于页面跳转要注意的几个问题总结
一些使用频率比较高的PHP函数
PHP5.2下preg_replace函数的问题
PHP-Push技术实现刷新功能
PHP动态图像的创建
PHP中重新定向到另一个页面
在PHP中将图片存放ORACLE中
PHP开发大型Web应用浅析
PHP正则相关的几个preg函数
PHP开发中最常见的文件操作疑难解答
面向普通人加密 使用PHP应用程序保护数据
记录PHP网站开发几个好功能

PHP中的DOM XML函数


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-08-14   浏览: 116 ::
收藏到网摘: n/a

DOMXMLfunctions
ThesefunctionsareonlyavailableifPHPwasconfiguredwith--with-dom=[DIR],usingtheGNOMExmllibrary.Youwillneedatleastlibxml-2.0.0(thebetaversionwillnotwork).ThesefunctionshavebeenaddedinPHP4.

Thismoduledefinesthefollowingconstants:

Table1.XMLconstants

ConstantValueDescription
XML_ELEMENT_NODE1
XML_ATTRIBUTE_NODE2
XML_TEXT_NODE3
XML_CDATA_SECTION_NODE4
XML_ENTITY_REF_NODE5
XML_ENTITY_NODE6
XML_PI_NODE7
XML_COMMENT_NODE8
XML_DOCUMENT_NODE9
XML_DOCUMENT_TYPE_NODE10
XML_DOCUMENT_FRAG_NODE11
XML_NOTATION_NODE12
XML_GLOBAL_NAMESPACE1
XML_LOCAL_NAMESPACE2

Thismoduledefinesanumberofclasses.TheDOMXMLfunctionsreturnaparsedtreeoftheXMLdocumentwitheachnodebeinganobjectbelongingtooneoftheseclasses.

xmldoc
(PHP4>=4.0b4)

xmldoc--CreatesaDOMobjectofanXMLdocument
Description

objectxmldoc(stringstr)


ThefunctionparsestheXMLdocumentinstrandreturnsanobjectofclass"Domdocument",havingtheproperties"doc"(resource),"version"(string)and"type"(long).

xmldocfile
(PHP4>=4.0b4)

xmldocfile--CreatesaDOMobjectfromXMLfile
Description

objectxmldocfile(stringfilename)


ThefunctionparsestheXMLdocumentinthefilenamedfilenameandreturnsanobjectofclass"Domdocument",havingtheproperties"doc"(resource),"version"(string).

xmltree
(PHP4>=4.0b4)

xmltree--CreatesatreeofphpobjectsfromXMLdocument
Description

objectxmltree(stringstr)


ThefunctionparsestheXMLdocumentinstrandreturnsatreePHPobjectsastheparseddocument.