Reset all options of a libcurl session handle

- « curl_pause

- curl_setopt_array »

- PHP Manual
- cURL Functions
- Reset all options of a libcurl session handle

# curl_reset

(PHP 5 >= 5.5.0, PHP 7, PHP 8)

curl_reset — Reset all options of a libcurl session handle

### Description

curl_reset(CurlHandle `$handle`): void

This function re-initializes all options set on the given cURL handle to the default values.

### Parameters

`handle`

  A cURL handle returned by curl_init().

### Return Values

No value is returned.

### Changelog

Version | Description
--- | ---
8.0.0 | `handle` expects a CurlHandle instance now; previously, a resource was expected.

### Examples

Example #1 curl_reset() example

    <?php// Create a curl handle$ch = curl_init();// Set CURLOPT_USERAGENT optioncurl_setopt($ch, CURLOPT_USERAGENT, "My test user-agent");// Reset all previously set optionscurl_reset($ch);// Send HTTP requestcurl_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// Close the handlecurl_close($ch);?>

### Notes

> Note:

> curl_reset() also resets the URL given as the curl_init() parameter.

### See Also

- curl_setopt() - Set an option for a cURL transfer