September 2001
Intermediate to advanced
768 pages
32h 45m
English
resource curl_init([string URL]) Initializes a cURL session.
Returns:
Valid cURL handle on success; FALSE on failure
Description:
curl_init attempts to initialize a cURL session. If successful, a descriptor is returned that can be used in further operations on the session; otherwise, FALSE is returned.
If URL is given and is a valid URL, the cURL session will use it in subsequent operations as the resource with which to work. If no value is given for URL , the resource can be set later using curl_setopt and the CURLOPT_URL option selector.
Example:
<?php /* One method of connecting...*/ if(!$curld = curl_init("http://www.php.net/")) { echo "Could not connect to the specified resource"; exit; } /* Alternate ... |
Read now
Unlock full access