php curl_init and curl_setopt functions
curl_init
(PHP 4" = 4.0.2, PHP 5)
curl_init - Initialize a curl session
Description
resource curl_init ([string$url=zero])
Initializes a new session and returns a curl handler used by the curl_setopt(), curl_exec(), and curl_close() functions.
Parameters
URL
If provided, the CURLOPT_URL option will be set to its value. You can set it manually using curl_setopt() function.
Return value
Returns a curl handler on success, false error.
Example
Example #1 Initialize a new curl session and get a web page
// create a new cURL resource
$ch = curl_init();
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, "http://www.111cn.cn/");
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);
?>