(PHP 5 >= 5.5.0)
curl_multi_setopt — Set a batch cURL transfer option.
bool curl_multi_setopt ( resource $mh , int $option , mixed $value )
Set a batch cURL transfer option.
ch
The cURL handle returned by curl_init().
option
CURLOPT_XXX options need to be set.
value
The value that will be set on option.
For the optional parameters of the following options, value should be set to a bool type value:
Options | Optional value | Remark |
---|---|---|
CURLOPT_AUTOREFERER | When redirecting based on Location:, the Referer: information in the header is automatically set. | |
CURLOPT_BINARYTRANSFER | Returns raw output when CURLOPT_RETURNTRANSFER is enabled. | |
CURLOPT_COOKIESESSION | When enabled, curl will only pass one session cookie and ignore other cookies. By default, curl will return all cookies to the server. Session cookies refer to cookies that are used to determine whether the server-side session is valid. | |
CURLOPT_CRLF | When enabled, converts Unix newlines to carriage returns and line feeds. | |
CURLOPT_DNS_USE_GLOBAL_CACHE | When enabled, a global DNS cache is enabled. This is thread-safe and enabled by default. | |
CURLOPT_FAILONERROR | Displays the HTTP status code. The default behavior is to ignore HTTP messages with numbers less than or equal to 400. | |
CURLOPT_FILETIME | When enabled, attempts to modify information in the remote document. The result information will be returned through the CURLINFO_FILETIME option of the curl_getinfo() function. curl_getinfo(). | |
CURLOPT_FOLLOWLOCATION | When enabled, the "Location:" returned by the server will be placed in the header and returned to the server recursively. Use CURLOPT_MAXREDIRS to limit the number of recursive returns. | |
CURLOPT_FORBID_REUSE | The connection is forced to disconnect after the interaction is completed and cannot be reused. | |
CURLOPT_FRESH_CONNECT | Forces a new connection to be obtained, replacing the one in the cache. | |
CURLOPT_FTP_USE_EPRT | When enabled, use the EPRT (or LPRT) command when FTP downloads. When set to FALSE disables EPRT and LPRT, use the PORT command only. | |
CURLOPT_FTP_USE_EPSV | When enabled, EPSV commands are first attempted before reverting to PASV mode during FTP transfers. Disables the EPSV command when set to FALSE . | |
CURLOPT_FTPAPPEND | When enabled append writes to the file instead of overwriting it. | |
CURLOPT_FTPASCII | Alias for CURLOPT_TRANSFERTEXT . | |
CURLOPT_FTPLISTONLY | When enabled, only the names of FTP directories are listed. | |
CURLOPT_HEADER | When enabled, the header file information will be output as a data stream. | |
CURLINFO_HEADER_OUT | Request string for tracing handles when enabled. | Available starting with PHP 5.1.3. The CURLINFO_ prefix is intentional. |
CURLOPT_HTTPGET | When enabled, the HTTP method will be set to GET. Because GET is the default, it will only be used if it is modified. | |
CURLOPT_HTTPPROXYTUNNEL | When enabled, transmission is via an HTTP proxy. | |
CURLOPT_MUTE | When enabled, all modified parameters in the cURL function will be restored to their default values. | |
CURLOPT_NETRC | After the connection is established, access the ~/.netrc file to obtain the username and password information to connect to the remote site. | |
CURLOPT_NOBODY | When enabled, the BODY part of the HTML will not be output. | |
CURLOPT_NOPROGRESS | Turn off the progress bar of curl transfer when enabled. The default setting of this item is enabled.
| |
CURLOPT_NOSIGNAL | When enabled, ignores all signals passed by curl to php. This item is enabled by default during SAPI multi-threaded transmission. | Added in cURL 7.10. |
CURLOPT_POST | When enabled, a regular POST request of type: application/x-www-form-urlencoded will be sent, just like a form submission. | |
CURLOPT_PUT | When enabled to allow HTTP to send files, both CURLOPT_INFILE and CURLOPT_INFILESIZE must be set. | |
CURLOPT_RETURNTRANSFER | Return the information obtained by curl_exec() in the form of a file stream instead of outputting it directly. | |
CURLOPT_SSL_VERIFYPEER | When disabled cURL will terminate validation from the server. Set the certificate using the CURLOPT_CAINFO option. Set the certificate directory using the CURLOPT_CAPATH option. If CURLOPT_SSL_VERIFYPEER (default 2) is enabled, CURLOPT_SSL_VERIFYHOST needs to be set to TRUE otherwise set to FALSE . | Defaults to TRUE since cURL 7.10. Starting with cURL 7.10, bundle installation is defaulted. |
CURLOPT_TRANSFERTEXT | When enabled, uses ASCII mode for FTP transfers. For LDAP, it retrieves plain text information rather than HTML. On Windows systems, the system does not set STDOUT to binary mode. | |
CURLOPT_UNRESTRICTED_AUTH | Continuously append username and password information to multiple locations in the header generated using CURLOPT_FOLLOWLOCATION , even if the domain name has changed. | |
CURLOPT_UPLOAD | Allow file uploads when enabled. | |
CURLOPT_VERBOSE | When enabled, all information will be reported and stored in STDERR or the specified CURLOPT_STDERR . |
Returns TRUE on success, or FALSE on failure.