close

 

<?php
// 創建一個url 句柄
$ch = curl_init();

// 設置 CURLOPT_USERAGENT 選項
curl_setopt($ch, CURLOPT_USERAGENT, "My test user-agent");

// 重置所有的預先設置的選項
curl_reset($ch);

// 發送 HTTP 請求
curl_setopt($ch, CURLOPT_URL, 'http://example.com/');
curl_exec($ch); // 預先設置的 user-agent 不會被發送,它已經被 curl_reset 重置掉了

// 關閉句柄
curl_close($ch);
?>

arrow
arrow
    全站熱搜

    stockwfj3 發表在 痞客邦 留言(0) 人氣()