php使用curl提交xml数据

时间:2014-08-13 22:45:47   收藏:0   阅读:449

$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使用curl提交xml数据,布布扣,bubuko.com

评论(0)
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!