php post 获取xml,php 获取post的xml数据并解析示例
這篇文章主要為大家詳細介紹了php 獲取post的xml數(shù)據(jù)并解析示例,具有一定的參考價值,可以用來參考一下。
對php獲取post過來的xml數(shù)據(jù)并解析感興趣的小伙伴,下面一起跟隨512筆記的小編兩巴掌來看看吧!
如何獲取請求的xml數(shù)據(jù),對方通過http協(xié)議post提交過來xml數(shù)據(jù),php如何獲取到這些數(shù)據(jù)呢?
/**
* php獲取post過來的xml數(shù)據(jù)并解析
*
* @param
* @arrange 五一二筆記網(wǎng): 512Pic.com
**/
$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);
/*** 來自512筆記(www.512pic.com) ***/
注:關于php 獲取post的xml數(shù)據(jù)并解析示例的內(nèi)容就先介紹到這里,更多相關文章的可以留意512筆記的其他信息。
關鍵詞:xml
總結
以上是生活随笔為你收集整理的php post 获取xml,php 获取post的xml数据并解析示例的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 如何下载Hbuilder,而不是下载Hb
- 下一篇: hbuilder php断点调试,Hbu