|
|
curl_exec (PHP 4 >= 4.0.2, PHP 5) curl_exec -- Perform a CURL session Descriptionmixed curl_exec ( resource ch )
This function should be called after you initialize a CURL
session and all the options for the session are set. Its purpose
is simply to execute the predefined CURL session (given by the
ch).
例子 1.
Initializing a new CURL session and fetching a webpage
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.example.com/");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
?>
|
|
注:
If you want to have the result returned instead of it being printed to the
browser directly, use the CURLOPT_RETURNTRANSFER option of
curl_setopt().
| |