PHP curl_share_setopt Function
(PHP 5 >= 5.5.0)
curl_share_setopt — Set an option for a cURL share handle.
Description
bool curl_share_setopt ( resource $sh , int $option , string $value )
Sets an option for a cURL share handle.
Parameters
sh
A share handle initialized by curl_share_init().
option
| Option | Description |
|---|---|
CURLSHOPT_SHARE |
Specifies the type of data to share |
CURLSHOPT_UNSHARE |
Specifies the type of data not to share |
value
| Value | Description |
|---|---|
CURL_LOCK_DATA_COOKIE |
Share cookie data |
CURL_LOCK_DATA_DNS |
Share the DNS cache. |
CURL_LOCK_DATA_SSL_SESSION |
Share SSL session IDs, reducing the time spent on the SSL handshake when connecting to the same server. |
Return Value
Returns TRUE on success, or FALSE on failure.
Example
This example creates a cURL share handle and adds two cURL handles that share cookie data.
PHP cURL Reference Manual