English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Basic PHP Tutorial

Advanced PHP Tutorial

PHP & MySQL

PHP Reference Manual

Usage and Example of PHP curl_reset() Function

PHP CURL Reference Manual

(PHP 5 >= 5.5.0)

curl_reset— Resets all options of the libcurl session handle.

Description

void curl_reset ( resource $ch )

This function will reinitialize all option values of CURL (default values).

Note:curl_reset() will also reset the URL parameters of curl_init().

Parameters

ch

The CURL handle returned by curl_init().

Return value

No return value.

Online 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 an HTTP request
curl_setopt($ch, CURLOPT_URL, 'http://oldtoolbag.com/');
curl_exec($ch); //The previously set user agent will not be sent, as it has been reset by curl_reset
// Close the handle
curl_close($ch);
?>

PHP CURL Reference Manual