English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
(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 initializing a CURL session 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 returns the execution result on success, and FALSE on failure.
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.oldtoolbag.com/"); curl_setopt($ch, CURLOPT_HEADER, 0); // Fetch the URL and pass it to the browser curl_exec($ch); // Close the CURL resource and release the system resources curl_close($ch); ?>