位置: 编程技术 - 正文
推荐整理分享PHP:curl_share_setopt()的用法_cURL函数,希望有所帮助,仅作参考,欢迎阅读内容。
文章相关热门搜索词:,内容如对您有帮助,希望把文章链接给更多的朋友!
(PHP 5 >= 5.5.0)
curl_share_setopt — Set an option for a cURL share handle.
说明 bool curl_share_setopt ( resource $sh , int $option , string $value )Sets an option on the given cURL share handle.
参数shA cURL share handle returned by curl_share_init().
optionOption Description CURLSHOPT_SHARE Specifies a type of data that should be shared. CURLSHOPT_UNSHARE Specifies a type of data that will be no longer shared.
valueValue Description CURL_LOCK_DATA_COOKIE Shares cookie data. CURL_LOCK_DATA_DNS Shares DNS cache. Note that when you use cURL multi handles, all handles added to the same multi handle will share DNS cache by default. CURL_LOCK_DATA_SSL_SESSION Shares SSL session IDs, reducing the time spent on the SSL handshake when reconnecting to the same server. Note that SSL session IDs are reused withing the same handle by default.
返回值成功时返回 TRUE, 或者在失败时返回 FALSE。
范例
Example #1 curl_share_setopt() example
This example will create a cURL share handle, add two cURL handles to it, and then run them with cookie data sharing.
<?php//CreatecURLsharehandleandsetittosharecookiedata$sh=curl_share_init();curl_share_setopt($sh,CURLSHOPT_SHARE,CURL_LOCK_DATA_COOKIE);//InitializethefirstcURLhandleandassignthesharehandletoit$ch1=curl_init("PHP:curl_share_init()的用法_cURL函数 curl_share_init(PHP5=5.5.0)curl_share_initInitializeacURLsharehandle说明resourcecurl_share_init(void)AllowstosharedatabetweencURLhandles.参数此函数没有参数。返回值Returnsresourceoftypec
PHP:curl_setopt_array()的用法_cURL函数 curl_setopt_array(PHP5=5.1.3)curl_setopt_array为cURL传输会话批量设置选项说明boolcurl_setopt_array(resource$ch,array$options)为cURL传输会话批量设置选项。这个函数对于需
PHP:curl_share_close()的用法_cURL函数 curl_share_close(PHP5=5.5.0)curl_share_closeCloseacURLsharehandle说明voidcurl_share_close(resource$sh)ClosesacURLsharehandleandfreesallresources.参数shAcURLsharehandlereturnedbycurl_share_init()
标签: PHP:curl_share_setopt()的用法_cURL函数
本文链接地址:https://www.jiuchutong.com/biancheng/280552.html 转载请保留说明!友情链接: 武汉网站建设