php使用curl提交xml數據

$str_callback_url="xxxx.com/api.php";
$str_callback_url="xml數據";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $str_callback_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_POST, 1);
$arr_header[] = "Content-type: text/xml";
curl_setopt($ch, CURLOPT_HTTPHEADER, $arr_header);
curl_setopt($ch, CURLOPT_POSTFIELDS, $str_xml);
$str_return_data = curl_exec($ch);php

相關文章
相關標籤/搜索