PHP 以POST方式提交XML、獲取XML,最後解析XML
以POST方式提交XML
// Do a POST $data="<?xml version='1.0' encoding='UTF-8'?> <TypeRsp> <CONNECT_ID>1</CONNECT_ID> <MO_MESSAGE_ID>2</MO_MESSAGE_ID> </TypeRsp>"; //$data = array('name' => 'Dennis', 'surname' => 'Pallett'); // create a new curl resource $ch = curl_init(); // set URL and other appropriate options curl_setopt($ch, CURLOPT_URL,"http://localhost/handle_form.php"); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); // grab URL, and print curl_exec($ch);
獲取POST來到XML,並解析
handle_form.php
re ,謝謝大家對本站的支持! 更多PHP 以POST方式提交XML、取得XML,解析XML詳解及實例相關文章請關注PHP中文網!