curl_reset

curl_reset

(PHP 5 >= 5.5.0, PHP 7)

curl_resetReset all options of a libcurl session handle

Description

void curl_reset ( resource $ch )

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

Parameters

ch

A cURL handle returned by curl_init().

Return Values

No value is returned.

Examples

Example #1 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

// Close the handle
curl_close($ch);
?>

Notes

Note:

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

See Also

© 1997–2017 The PHP Documentation Group
Licensed under the Creative Commons Attribution License v3.0 or later.
https://secure.php.net/manual/en/function.curl-reset.php

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部