Query: curl_init
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
CURL_INIT(3) 1 CURL_INIT(3) curl_init - Initialize a cURL sessionSYNOPSISresource curl_init NULL ([string $url])DESCRIPTIONInitializes a new session and return a cURL handle for use with the curl_setopt(3), curl_exec(3), and curl_close(3) functions.PARAMETERSo $url - If provided, the CURLOPT_URL option will be set to its value. You can manually set this using the curl_setopt(3) function. Note The file protocol is disabled by cURL if open_basedir is set.RETURN VALUESReturns a cURL handle on success, FALSE on errors.EXAMPLESExample #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); ?>SEE ALSOcurl_close(3), curl_multi_init(3). PHP Documentation Group CURL_INIT(3)