Home >Backend Development >PHP Tutorial >PHP obtains xml data submitted through http protocol post and parses xml_PHP tutorial

PHP obtains xml data submitted through http protocol post and parses xml_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 15:14:511122browse

How does PHP obtain the requested XML data? The other party submits the XML data through HTTP protocol post. How does PHP obtain this data?

Copy code The code is as follows:

$xml_data =''.
''.
'1234567890'. Password>'.
'phpmind.com'.
'
'. ="" ID="1">'.
''.
'''.
'JHM'. ;101009'.
'101509'. 🎜>'
';
$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 t ($ 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);
?>





http://www.bkjia.com/PHPjc/326221.html

www.bkjia.com

true
http: //www.bkjia.com/PHPjc/326221.html

TechArticle

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn