(PHP 4 >= 4.0.2, PHP 5)
curl_init — Initialize a cURL session
resource curl_init ([ string $url = NULL ] )
Initializes a new session and returns a cURL handle for use by the curl_setopt(), curl_exec() and curl_close() functions.
url
If this parameter is provided, the CURLOPT_URL option will be set to this value. You can also set this value manually using the curl_setopt() function.
If successful, returns a cURL handle, returns FALSE on error.
Initialize a new cURL session and get a web page
<?php// Create a new cURL resource $ch = curl_init();// Set the URL and corresponding options curl_setopt($ch, CURLOPT_URL, "http://www.codercto.com/"); curl_setopt($ch , CURLOPT_HEADER, 0);// Grab the URL and pass it to the browser curl_exec($ch);// Close cURL resources and release system resources curl_close($ch);?>