我有以下 XML 代码
<epp:epp xmlns:epp="urn:ietf:params:xml:ns:epp-1.0">
<epp:response>
<epp:result code="1000">
<epp:msg>Contact Info Command completed successfully</epp:msg>
</epp:result>
<epp:resData>
<contact:infData xmlns:contact="urn:ietf:params:xml:ns:contact-1.0">
<contact:id>con12</contact:id>
<contact:status s="ok"/>
<contact:postalInfo type="loc">
<contact:name>Name</contact:name>
<contact:org/>
<contact:addr>
<contact:street>streer</contact:street>
<contact:street>street</contact:street>
<contact:street/>
<contact:city>City</contact:city>
<contact:sp/>
<contact:pc>186</contact:pc>
<contact:cc>AA</contact:cc>
</contact:addr>
</contact:postalInfo>
<contact:voice>0000000</contact:voice>
<contact:fax>000000000</contact:fax>
<contact:email>support@email.com</contact:email>
</contact:infData>
</epp:resData>
</epp:response>
</epp:epp>
我在使用 simplexml_load_string 从 XML 字符串中获取值时遇到困难
我可以得到所有以epp开头的节点的结果:比如epp:msg uinsg下面的代码
$objects = simplexml_load_string($result);
$objects->children('epp', true)->response->result->msg;
我似乎无法获得以下值
<contact:infData xmlns:contact="urn:ietf:params:xml:ns:contact-1.0">
<contact:id>con12</contact:id>
<contact:status s="ok"/>
<contact:postalInfo type="loc">
<contact:name>Name</contact:name>
<contact:org/>
<contact:addr>
<contact:street>streer</contact:street>
<contact:street>street</contact:street>
<contact:street/>
<contact:city>City</contact:city>
<contact:sp/>
<contact:pc>186</contact:pc>
<contact:cc>AA</contact:cc>
</contact:addr>
</contact:postalInfo>
<contact:voice>0000000</contact:voice>
<contact:fax>000000000</contact:fax>
<contact:email>support@email.com</contact:email>
</contact:infData>
我还需要知道如何获取代码值<epp:result code="1000">
任何帮助/指针将不胜感激,