0
有什麼辦法來設置cURL與<
和<
代替<
和>
cURL將XML發送到webservice。需要不同的編碼
$xml_data = '
<Shipping_Address>
<Province>BC</Province>
<Country>Canada</Country>
<PostalCode>V6P 5T2</PostalCode>
<Phone>604-561-7977</Phone>
</Shipping_Address>';
$ch = curl_init($URL);
curl_setopt($ch, CURLOPT_MUTE, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml','charset=ISO-8859-1'));
curl_setopt($ch, CURLOPT_POSTFIELDS, "$xml_data");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
var_dump($output);
是的,我知道它的奇怪。我想知道是否有特定的cURL選項。只是這樣做,我猜thx。 –