php8.5
Home/ Manual/ curl / functions/ curl_close

curl_close

PHP function Deprecated as of PHP 8.5.0 Edit on GitHub ✎

(PHP 4 >= 4.0.2, PHP 5, PHP 7, PHP 8)

Close a cURL session

Function-8-5-0

Description

curl_close(CurlHandle $handle): void

0-dead-function

Closes a cURL session and frees all resources. The cURL handle, handle, is also deleted.

Parameters

Return Values

Void

Changelog

VersionDescription
8.5.0This function has been deprecated.
8.0.0This function is a NOP now.

Examples

Initializing a new cURL session and fetching a web page

php
<?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);
?>

See Also

Source: reference/curl/functions/curl-close.xml · from the official PHP manual (php/doc-en)