首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

curl_copy_handle

(PHP 5, PHP 7)

curl_copy_handle - 复制 cURL 句柄及其所有首选项

描述

代码语言:javascript
复制
resource curl_copy_handle ( resource $ch )

复制 cURL 句柄,保持相同的偏好。

参数

ch

由 curl_init()返回的 cURL 句柄。

返回值

返回一个新的 cURL 句柄。

示例

示例#1 复制 cURL 句柄

代码语言:javascript
复制
<?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);
?>

← curl_close

curl_errno →

扫码关注腾讯云开发者

领取腾讯云代金券