Basic Usage GET Requests

suggest change

cURL transfers data using URL syntax. It supports HTTP, FTP, SCP, and many other protocols (cURL >= 7.19.4). Remember, you need to install and enable the cURL extension to use it.

// check whether the cURL extension is loaded
if(!extension_loaded("curl")) {
    die("cURL extension not loaded! Quit Now.");
}

// Actual script start

// create a new cURL resource
// $curl is the handle of the resource
$curl = curl_init();

// set the URL and other options
curl_setopt($curl, CURLOPT_URL, "http://www.example.com");

// execute and pass the result to browser
curl_exec($curl);

// close the cURL resource
curl_close($curl);

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents