用curl$ch = curl_init();$header[] = "Content-type: text/xml";//定義content-type為xmlcurl_setopt($ch, CURLOPT_URL, $url); //定義表單提交地址curl_setopt($ch, CURLOPT_POST, 1); //定義提交型別 1:POST ;0:GETcurl_setopt($ch, CURLOPT_HEADER, 1); //定義是否顯示狀態頭 1:顯示 ; 0:不顯示curl_setopt($ch, CURLOPT_HTTPHEADER, $header);//定義請求型別 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);//定義是否直接輸出返回流 curl_setopt($ch, CURLOPT_POSTFIELDS, $postStr); //定義提交的資料,這裡是XML檔案 $res = curl_exec($ch);curl_close($ch);//關閉
用curl$ch = curl_init();$header[] = "Content-type: text/xml";//定義content-type為xmlcurl_setopt($ch, CURLOPT_URL, $url); //定義表單提交地址curl_setopt($ch, CURLOPT_POST, 1); //定義提交型別 1:POST ;0:GETcurl_setopt($ch, CURLOPT_HEADER, 1); //定義是否顯示狀態頭 1:顯示 ; 0:不顯示curl_setopt($ch, CURLOPT_HTTPHEADER, $header);//定義請求型別 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);//定義是否直接輸出返回流 curl_setopt($ch, CURLOPT_POSTFIELDS, $postStr); //定義提交的資料,這裡是XML檔案 $res = curl_exec($ch);curl_close($ch);//關閉