Función PHP curl_reset
Manual de referencia de PHP cURL
(PHP 5 >= 5.5.0)
curl_reset — Restablece todas las opciones del identificador de sesión libcurl.
Descripción
void curl_reset ( resource $ch )
Esta función restablece todos los valores de opciones de cURL (valores predeterminados).
Nota:curl_reset() también restablece el parámetro URL de curl_init().
Parámetros
ch
El identificador de cURL devuelto por curl_init().
Valor de retorno
No devuelve ningún valor.
Ejemplo
<?php // 创建一个cURL句柄 $ch = curl_init(); // 设置 CURLOPT_USERAGENT 选项 curl_setopt($ch, CURLOPT_USERAGENT, "My test user-agent"); // 重置所有先前设置的选项 curl_reset($ch); // 发送 HTTP 请求 curl_setopt($ch, CURLOPT_URL, 'http://w3cschool.cc/'); curl_exec($ch); // the previously set user-agent will be not sent, it has been reset by curl_reset // 关闭句柄 curl_close($ch); ?>
Otras extensiones