(PHP 4 >= 4.0.2, PHP 5)
curl_exec — Execute a cURL session
mixed curl_exec (resource $ch)
Execute the given cURL session.
This function should be called after a cURL session has been initialized and all options have been set.
ch
The cURL handle returned by curl_init().
Returns TRUE on success, or FALSE on failure. However, if the CURLOPT_RETURNTRANSFER option is set, the function will return the execution result if it succeeds, and FALSE if it fails.
Get a web page
<?php// Create a cURL resource $ch = curl_init();// Set the URL and corresponding options curl_setopt($ch, CURLOPT_URL, "http://www.w3cschool.cc/"); 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);?>