美文网首页
php 解析 xml

php 解析 xml

作者: 花钱约下 | 来源:发表于2018-11-22 17:44 被阅读0次
$xmlStr = <<<XML
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
        <client_insetResponse xmlns="http://127.0.0.1/webservices/">
            <client_insetResult>0|</client_insetResult>
        </client_insetResponse>
    </soap:Body>
</soap:Envelope>
XML;

$xmlObj = simplexml_load_string($xmlStr);
$xmlObj->registerXPathNamespace('soap', 'http://schemas.xmlsoap.org/soap/envelope/');
$result = $xmlObj->xpath("soap:Body");

print_r($result);

相关文章

  • XML数据的操作

    1、XML的基本语法 2、php解析XML ①php解析XML文件或者字符串所使用的函数 ②通过foreach或者...

  • php 解析 xml

  • xml 解析错误

    PHP xml 解析错误 错误内容: simplexml_load_string(): input convers...

  • php问题收集

    1.解析xml时出现如下错误:php Fatal error: Class 'DOMDocument' not f...

  • iOS解析XML

    2.0 XML解析 2.1 XML简单介绍 (1) XML:可扩展标记语言 (2) XML解析 2.2 XML解析...

  • iOS开发-XML解析

    一、 XML解析 1.1 XML简单介绍 (1) XML:可扩展标记语言 (2) XML解析 1.2 XML解析 ...

  • 3-XML解析

    3.0 XML解析 3.1 XML简单介绍 (1) XML:可扩展标记语言 (2) XML解析 3.2 XML解析...

  • XML、JSON解析

    XML解析 XML_GData解析 JSON解析

  • 05、网络解析

    解析:从事先规定好的格式中提取数据iOS开发常见的解析:XML解析,JSON解析 XML解析 XMl事例: XML...

  • Senior进阶 网络之数据解析之XML解析和JSON解析的用法

    Senior进阶 网络之数据解析之XML解析和JSON解析的用法 XML解析之SAX解析 XML解析之DOM解析 ...

网友评论

      本文标题:php 解析 xml

      本文链接:https://www.haomeiwen.com/subject/kpfrqqtx.html