欢迎您访问我爱IT技术网,今天小编为你分享的编程技术是:【PHP中的DOM XML函数】,下面是详细的分享!
PHP中的DOM XML函数
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.
以上所分享的是关于PHP中的DOM XML函数,下面是编辑为你推荐的有价值的用户互动:
相关问题:php dom操作xml save()函数 路径问题
答:$xmldoc->save("./Public/issac.xml");要加一个点,表示在根目录下面 >>详细
相关问题:php DOM对象如何解析XML?
答:你要怎么才算是解析?这个是手册上的例子,是要去xml里面的值?这个已经可以实现了,还是实现xml的增删改?请说明白一点! getAttribute('name').''; } ?> >>详细
相关问题:php中soapClient如何配置
答:一、Linux下安装soap模块 安装完php后最好保留当时安装的文件,比如usr/local/php-5.3.2 查看soap模块是否安装的办法:在php的安装目录下运行php -m来查看 如:/usr/local/php/bin/php -m |grep ‘soap’ 如果没有安装,则进入php的安装源文件夹 c... >>详细
- 评论列表(网友评论仅供网友表达个人看法,并不表明本站同意其观点或证实其描述)
-
