XML database is a data management system that supports the storage and querying of XML (an application in standard Universal Markup Language) format document. In the system, developers can query, export, and specify the serialization of XML documents in the database.
This article mainly introduced the PHP processing complex XML data method, combined with the instance form analysis PHP for the XML format data reading, loading, traversal, operation and other related operation skills, need friends can refer to the next
<?php$xml = <<< xml<?xml version= "1.0" encoding= "Utf-8"? ><epp xmlns= "Urn:ietf:params:xml:ns: epp-1.0 "xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance "xsi:schemalocation=" Urn:ietf:params:xml:ns: epp-1.0 epp-1.0.xsd "> <response> <result code=" + "> <msg>command completed successfully</ msg> </result> <resData> <domain:chkdata xmlns:domain= "urn:ietf:params:xml:ns:domain-1.0" xsi: schemalocation= "urn:ietf:params:xml:ns:domain-1.0 domain-1.0.xsd" > <domain:cd> <domain:name avail= "0" & gt;qq.com</domain:name> <domain:reason>domain exists</domain:reason> </domain:cd> <do Main:cd> <domain:name avail= "1" >baidu.com</domain:name> <domain:reason>domain Exists</doma in:reason> </domain:cd> </domain:chkData> </resData> <trID> <cltrid>req-001-0000 000074</cltrid> <svtrid>649334436-1440642163169</svtrid> </trID> </response></epp>XML; $x = simplexml_load_string ($xml); Echo intval ($x- >response->result["Code"]), "\ n"; Echo strval ($x->response->result->msg), "\ n"; $ns = $x->response- >resdata->getnamespaces (true); $cds = $x->response->resdata->children ($ns ["Domain"])->chkdata- >cd;foreach ($cds as $key = $value) {echo intval ($value->name->attributes () ["Avail"]), Strval ($value, Name), Strval ($value->reason), "\ n";}