php获取通过http协议post提交过来xml数据及解析xml

前端之家收集整理的这篇文章主要介绍了php获取通过http协议post提交过来xml数据及解析xml前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

PHP 如何获取请求的xml数据,对方通过http协议post提交过来xml数据,PHP如何获取到这些数据呢?@H_502_0@<div class="codetitle"><a style="CURSOR: pointer" data="56061" class="copybut" id="copybut56061" onclick="doCopy('code56061')"> 代码如下:

<div class="codebody" id="code56061"> @H_502_0@<?PHP @H_502_0@$xmldata =''. @H5020@''. @H5020@'1234567890'. @H5020@'lgsoftwares'. @H5020@'mypassword'. @H502_0@'PHPmind.com'. @H_5020@''. @H5020@''. @H5020@'<Adult AGE="" ID="1">'. @H5020@'<Adult AGE="" ID="2">'. @H5020@''. @H5020@''. @H5020@'JHM'. @H5020@'OGGSHE'. @H5020@'101009'. @H5020@'101509'. @H5020@'1'. @H5020@''. @H5020@''; @H5020@$URL = "https://www.yourwebserver.com/path/"; @H502_0@$ch = curlinit($URL); @H502_0@curl_setopt($ch,CURLOPTMUTE,1); @H502_0@curl_setopt($ch,CURLOPT_SSLVERIFYHOST,0); @H502_0@curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,CURLOPT_POST,CURLOPTHTTPHEADER,array('Content-Type: text/xml')); @H502_0@curl_setopt($ch,CURLOPT_POSTFIELDS,"$xmldata"); @H502_0@curl_setopt($ch,CURLOPTRETURNTRANSFER,1); @H502_0@$output = curlexec($ch); @H502_0@curlclose($ch); @H5020@?> @H502_0@

原文链接:https://www.f2er.com/php/26849.html

猜你在找的PHP相关文章