English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
(PHP 5)
curl_copy_handle — Copy a CURL handle and all its options
resource curl_copy_handle ( resource $ch )
Copy a CURL handle and maintain the same options.
ch
The CURL handle returned by curl_init().
Return a new CURL handle.
Copy a CURL handle
<?php // Create a new CURL resource $ch = curl_init(); // Set the URL and corresponding options curl_setopt($ch, CURLOPT_URL, 'http://www.oldtoolbag.com/'); curl_setopt($ch, CURLOPT_HEADER, 0); // Copy the handle $ch2 = curl_copy_handle($ch); // Crawl URL (http://www.oldtoolbag.com/) and pass it to the browser curl_exec($ch2); // Close the CURL resource and release system resources curl_close($ch2); curl_close($ch); ?>