cURL curl_copy_handle
(PHP 5, PHP 7, PHP 8)
curl_copy_handle — 모든 기본 설정과 함께 cURL 핸들 복사
설명
curl_copy_handle(CurlHandle $handle
): CurlHandle|false
동일한 기본 설정을 유지하는 cURL 핸들을 복사합니다.
매개변수
handle
- curl_init()에서 반환된 cURL 핸들입니다.
반환 값
새 cURL 핸들을 반환하거나 실패 시 false
를 반환합니다.
변경 로그
버전 | 설명 |
---|---|
8.0.0 | handle 은 이제 CurlHandle 인스턴스를 예상합니다. 이전에는 리소스가 필요했습니다. |
8.0.0 | 성공하면 이 함수는 이제 CurlHandle 인스턴스를 반환합니다. 이전에는 리소스가 반환되었습니다. |
Examples
예제 #1 cURL 핸들 복사
<?php
// create a new cURL resource
$ch = curl_init();
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, 'http://www.example.com/');
curl_setopt($ch, CURLOPT_HEADER, 0);
// copy the handle
$ch2 = curl_copy_handle($ch);
// grab URL (http://www.example.com/) and pass it to the browser
curl_exec($ch2);
// close cURL resources, and free up system resources
curl_close($ch2);
curl_close($ch);
?>