curl_close
来源:互联网 发布:2017出境旅游数据 编辑:程序博客网 时间:2024/06/03 19:51
curl_close
(PHP 4 >= 4.0.2, PHP 5)
curl_close — Close a cURL session
Report a bug
Description
void curl_close ( resource $ch )
Closes a cURL session and frees all resources. The cURL handle, ch, is also deleted.
Report a bug
Parameters
- ch
A cURL handle returned by curl_init().
Report a bug
Return Values
No value is returned.
Report a bug
Examples
Example #1 Initializing a new cURL session and fetching a web page
<?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);
// grab URL and pass it to the browser
curl_exec($ch);
// close cURL resource, and free up system resources
curl_close($ch);
?>
Report a bug
See Also
- curl_init() - Initialize a cURL session
- curl_multi_close() - Close a set of cURL handles