PHP curl_exec function
PHP curl_exec function
(PHP 4> = 4.0.2, PHP 5)
curl_exec - execute a cURL session
Explanation
mixed curl_exec ( resource $ch )
Execute the given cURL session.
This function should initialize a cURL session and all the options are set after the call.
parameter
ch
By the curl_init () returns a cURL handle.
return value
Successful return TRUE, or on failure returns FALSE. However, if CURLOPT_RETURNTRANSFER option is set, the function will return the results of the implementation of the success, or FALSE on failure.
Examples
Get a web page
<?php // 创建一个cURL资源 $ch = curl_init(); // 设置URL和相应的选项 curl_setopt($ch, CURLOPT_URL, "http://www.w3cschool.cc/"); curl_setopt($ch, CURLOPT_HEADER, 0); // 抓取URL并把它传递给浏览器 curl_exec($ch); // 关闭cURL资源,并且释放系统资源 curl_close($ch); ?>