一个解析XML的有关问题,多谢

php中文网
发布: 2016-06-13 13:30:02
原创
983人浏览过

请教大家一个解析XML的问题,谢谢

XML code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--> <alipay>
  <is_success>T</is_success>
  <request>
    <param   name="partner">2088002007***</param>
    <param   name="logistics_name">天天</param>
    <param   name="create_transport_type">EMS</param>
    <param   name="trade_no">2008040902***</param>
    <param   name="agent">20880020070***</param>
    <param   name="notify_url">
      http://10.2.5.100/api/apireceive/returnSuccess.php</param>
      <param   name="invoice_no">3455**</param>
      <param       name="service">send_goods_confirm_by_platform</param>
      <param       name="_input_charset">utf-8</param>
      <param       name="transport_type">EMS</param>
      <param   name="return_url">http://10.2.5.100/api/returnResultList.php</param>
    </request>
  <response>
    <tradeBase>
      <buyer_account>2088002007301423***</buyer_account>
      <buyer_actions>[REFUND,CONFIRM_GOODS]</buyer_actions>
      <buyer_login_email>***</buyer_login_email>
      <buyer_type>PRIVATE_ACCOUNT</buyer_type>
      <buyer_user_id>2088002007****</buyer_user_id>
      <channel>interface/digi***</channel>
      <create_time>2008-04-09       16:10:25</create_time>
      <currency>156</currency>
      <gathering_type>1</gathering_type>
      <last_modified_time>2008-04-10 14:35:25</last_modified_time>
      <operator_role>B</operator_role>
      <out_trade_no>123455666***</out_trade_no>
      <partner_id>2088002007***6</partner_id>
      <seller_account>208800200730***156</seller_account>
      <seller_actions>[EXTEND_TIMEOUT]</seller_actions>
      <seller_login_email>song_xia**hoo.com.cn</seller_login_email>
      <seller_type>PRIVATE**OUNT</seller_type>
      <seller_user_id>208800**301410</seller_user_id>
      <service_fee>0.00</service_fee>
      <service_fee_ratio>0.0</service_fee_ratio>
      <stop_timeout>F</stop_timeout>
      <total_fee>2.00</total_fee>
      <trade_from>INST_P**ER</trade_from>
      <trade_no>2008040**81748</trade_no>
      <trade_status>WAIT_BUYER_CONFIRM_GOODS</trade_status>
      <trade_type>S</trade_type>
    </tradeBase>
  </response>
  <sign>eb07c7407baf*****0804751a21c1e</sign>
  <sign_type>MD5</sign_type>
</alipay>


登录后复制


我想获取alipay下的is_success节点的值 。 
我是的代码是这样写的
$message=$doc->getElementsByTagName("alipay")->item(0)->nodeValue;
但是好像获取的值不对。 请教下大家如何获取这个值了。 谢谢

------解决方案--------------------
$message=$doc->getElementsByTagName("is_success")->item(0)->nodeValue;
最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号