curl_setopt($ch, CURLOPT_USERAGENT, "Google Bot");
CURLOPT_USERAGENT
在HTTP請求中包含一個「user-agent」頭的字符串。
瀏覽器的user agent
例如
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3");
CURLOPT_USERAGENT => "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:29.0) Gecko/20100101 Firefox/29.0"
文章標籤
全站熱搜
