curl-reset
curl_reset
Reset all options of a libcurl session handle
ENTITY
void
curl_reset
CurlHandle
handle
This function re-initializes all options set on the given cURL handle to the default values.
ENTITY
ENTITY
ENTITY
ENTITY
| ENTITY | ENTITY |
|---|
ENTITY
curl_reset example
<?php
// Create a curl handle
$ch = curl_init();
// Set CURLOPT_USERAGENT option
curl_setopt($ch, CURLOPT_USERAGENT, "My test user-agent");
// Reset all previously set options
curl_reset($ch);
// Send HTTP request
curl_setopt($ch, CURLOPT_URL, 'http://example.com/');
curl_exec($ch); // the previously set user-agent will be not sent, it has been reset by curl_reset
?>
ENTITY
[!NOTE]
curl_resetalso resets the URL given as thecurl_initparameter.
ENTITY
curl_setopt
这篇文档对你有帮助吗?
谢谢你的反馈!