English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Online Tools

PHP Basic Tutorial

PHP Advanced Tutorial

PHP & MySQL

Object Function

PHP CURL Reference Manual

PHP curl_share_close() Function Usage and Example 5 (PHP 5>=5.

.0)

curl_share_close — Close CURL shared handle

Syntax

void curl_share_close ( resource $sh )

Close CURL shared handle and release all resources.

Parameter

sh

Returned by curl_share_init().

Return Value

No return value.

Online Example

This example will create a CURL shared handle and add two CURL handles, sharing cookie data between the two handles.
// <?php
Create a CURL shared handle and set cookie data
$sh = curl_share_init();
// curl_share_setopt($sh, CURLSHOPT_SHARE, CURL_LOCK_DATA_COOKIE);
Initialize the second CURL handle and specify it as a shared handle1 $ch//Initialize the first CURL handle and specify it as a shared handle3codebox.com/php.net
");1, CURLOPT_SHARE, $sh);
// www.w
curl_exec($ch1);
// Execute the first CURL handle
Initialize the second CURL handle and specify it as a shared handle2 $ch//= curl_init("http:/php.net
");2, CURLOPT_SHARE, $sh);
// Execute the second CURL handle
//  All $ch1 The data in handle $ch2 Shared in handle
curl_exec($ch2);
// Close CURL shared handle
curl_share_close($sh);
// Close CURL handle
curl_close($ch1);
curl_close($ch2);
?>

PHP CURL Reference Manual