Easy Tutorial
❮ Func Array Compact Php Empty Function ❯

PHP curl_copy_handle Function

PHP cURL Reference Manual

(PHP 5)

curlcopyhandle — Copies a cURL handle along with all of its options


Description

resource curl_copy_handle ( resource $ch )

Copies a cURL handle keeping the same options.


Parameters

ch

A cURL handle returned by curl_init().


Return Values

Returns a new cURL handle.


Example

Copying a cURL handle

<?php
// Create a new cURL resource
$ch = curl_init();

// Set URL and corresponding options
curl_setopt($ch, CURLOPT_URL, 'http://www.example.com/');
curl_setopt($ch, CURLOPT_HEADER, 0);

// Copy the handle
$ch2 = curl_copy_handle($ch);

// Fetch the URL (http://www.example.com/) and pass it to the browser
curl_exec($ch2);

// Close the cURL resources and release system resources
curl_close($ch2);
curl_close($ch);
?>

PHP cURL Reference Manual

❮ Func Array Compact Php Empty Function ❯