|
|
 |
curl_setopt (PHP 4 >= 4.0.2, PHP 5) curl_setopt -- Set an option for a CURL transfer Descriptionbool curl_setopt ( resource ch, int option, mixed value )
Set an option for a CURL session identified by the
ch parameter. option
specifies which option to set, and
value specifies the value for the option given.
value should be a bool for the
following values of the option parameter:
value should be an integer for the
following values of the option parameter:
value should be a string for the
following values of the option parameter:
value should be an array for the
following values of the option parameter:
value should be a stream resource (using
fopen(), for example) for the following values of the
option parameter:
value should be a string that is the name of a valid
callback function for the following values of the
option parameter:
例子 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, false);
curl_exec($ch);
curl_close($ch);
?>
|
|
| |