cURL curl_reset

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

curl_reset — libcurl 세션 핸들의 모든 옵션 재설정


설명

curl_reset(CurlHandle $handle): void

이 함수는 지정된 cURL 핸들에 설정된 모든 옵션을 기본값으로 다시 초기화합니다.


매개변수

handle
curl_init()에서 반환된 cURL 핸들입니다.

반환 값

값이 반환되지 않습니다.


Examples

예제 #1 curl_reset() 예제

                  
<?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);
?>
                  
                

메모

메모: curl_reset()은 또한 curl_init() 매개변수로 지정된 URL을 재설정합니다.


기타