Maison  >  Article  >  développement back-end  >  php获取通过http协议post提交过来xml数据及解析xml_PHP教程

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

WBOY
WBOYoriginal
2016-07-21 15:14:511051parcourir

php 如何获取请求的xml数据,对方通过http协议post提交过来xml数据,php如何获取到这些数据呢?

复制代码 代码如下:

$xml_data =''.
''.
'1234567890'.
'lgsoftwares'.
'mypassword'.
'phpmind.com'.
'
'.
''.
''.
''.
'
'.
''.
'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, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, 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);
?>

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/326221.htmlTechArticlephp 如何获取请求的xml数据,对方通过http协议post提交过来xml数据,php如何获取到这些数据呢? 复制代码 代码如下: ?php $xml_data ='AATAvailReq1'....
Déclaration:
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn