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

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

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

<div class="codebody" id="code56061">
<?PHP
$xml_data =''.
''.
'1234567890'.
'lgsoftwares'.
'mypassword'.
'PHPmind.com'.
'
'.
''.
'<Adult AGE="" ID="1">'.
'<Adult AGE="" ID="2">'.
'
'.
''.
'JHM'.
'OGGSHE'.
'101009'.
'101509'.
'1'.
'
'.
'
';
$URL = "https://www.yourwebserver.com/path/";
$ch = curl_init($URL);
curl_setopt($ch,CURLOPT_MUTE,1);
curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,0);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,CURLOPT_POST,CURLOPT_HTTPHEADER,array('Content-Type: text/xml'));
curl_setopt($ch,CURLOPT_POSTFIELDS,"$xml_data");
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
$output = curl_exec($ch);
curl_close($ch);
?>

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

猜你在找的PHP相关文章