(PHP 5 >= 5.5.0, PHP 7)
curl_reset — 锟斤拷锟斤拷一锟斤拷 libcurl 锟结话锟斤拷锟斤拷锟斤拷锟斤拷械锟窖★拷锟�
$ch
) : void锟矫猴拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷 cURL 锟斤拷锟斤拷锟斤拷锟窖★拷锟斤拷锟斤拷锟斤拷锟斤拷锟轿拷锟街碉拷锟�
ch
锟斤拷 curl_init() 锟斤拷锟截碉拷 cURL 锟斤拷锟斤拷锟�
没锟叫凤拷锟斤拷值锟斤拷
Example #1 curl_reset() 示锟斤拷
<?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 锟斤拷锟结被锟斤拷锟酵o拷锟斤拷锟窖撅拷锟斤拷 curl_reset 锟斤拷锟矫碉拷锟斤拷
// 锟截闭撅拷锟�
curl_close($ch);
?>
Note:
curl_reset() also resets the URL given as the curl_init() parameter.