curl_init

(csak PHP4 CVS)

curl_init -- Initialize a CURL session

Description

int curl_init ([string url])

The curl_init() will initialize a new session and return a CURL handle for use with the curl_setopt(), curl_exec(), and curl_close() functions. If the optional url parameter is supplied then the CURLOPT_URL option will be set to the value of the parameter. You can manually set this using the curl_setopt() function.

Példa 1. Initializing a new CURL session and fetching a webpage

  1 
  2 <?php
  3 $ch = curl_init();
  4 
  5 curl_setopt ($ch, CURLOPT_URL, "http://www.zend.com/");
  6 curl_setopt ($ch, CURLOPT_HEADER, 0);
  7 
  8 curl_exec ($ch);
  9 
 10 curl_close ($ch);
 11 ?>
 12       

See also: curl_close(), curl_setopt()