PHP curl_multi_setopt Function
(PHP 5 >= 5.5.0)
curl_multi_setopt — Sets a batch cURL transfer option.
Description
bool curl_multi_setopt ( resource $mh , int $option , mixed $value )
Sets a batch cURL transfer option.
Parameters
ch
A cURL handle returned by curl_init().
option
A CURLOPT_XXX option to set.
value
The value to be set on the option.
For the following optional parameters of these options, value should be set to a bool value:
| Option | OptionalvalueValue | Notes |
|---|---|---|
| CURLOPT_AUTOREFERER | When according toLocation:redirecting, automatically set the header'sReferer:information. | |
| CURLOPT_BINARYTRANSFER | When enabledCURLOPT_RETURNTRANSFER, return the native (Raw) output. | |
| CURLOPT_COOKIESESSION | When enabled, curl will only pass a session cookie and ignore other cookies. By default, cURL returns all cookies to the server. Session cookies are cookies that exist to determine whether the server-side session is valid. | |
| CURLOPT_CRLF | When enabled, converts Unix line endings to carriage return line endings. | |
| CURLOPT_DNS_USE_GLOBAL_CACHE | When enabled, a global DNS cache is enabled. This option is thread-safe and enabled by default. | |
| CURLOPT_FAILONERROR | Displays HTTP status codes. The default behavior is to ignore HTTP messages with codes less than or equal to 400. | |
| CURLOPT_FILETIME | When enabled, it will attempt to modify the information in the remote document. The result information will be returned through the curl_getinfo() function'sCURLINFO_FILETIMEoption. curl_getinfo(). | |
| CURLOPT_FOLLOWLOCATION | When enabled, the server returned"Location: "is placed in the header and recursively returned to the server. UseCURLOPT_MAXREDIRSto limit the number of recursive returns. | |
| CURLOPT_FORBID_REUSE | Forcefully disconnects after the interaction is completed; it cannot be reused. | |
| CURLOPT_FRESH_CONNECT | Forcefully obtains a new connection, replacing the connection in the cache. | |
| CURLOPT_FTP_USE_EPRT | When enabled, uses the EPRT (or LPRT) command for FTP downloads. When set toFALSE, disables EPRT and LPRT, and uses the PORT command only. | |
| CURLOPT_FTP_USE_EPSV | When enabled, first tries the EPSV command before reverting to PASV mode during FTP transfers. When set toFALSE, disables the EPSV command. | |
| CURLOPT_FTPAPPEND | When enabled, appends to the file instead of overwriting it. | |
| CURLOPT_FTPASCII | CURLOPT_TRANSFERTEXTAn alias of. | |
| CURLOPT_FTPLISTONLY | When enabled, only lists the names of the FTP directory. | |
| CURLOPT_HEADER | When enabled, header information is output as a data stream. | |
| CURLINFO_HEADER_OUT | When enabled, tracks the handle's request string. | Available from PHP 5.1.3 onwards.CURLINFO_The prefix is intentional. |
| CURLOPT_HTTPGET | When enabled, sets the HTTP method to GET. Since GET is the default, it is only used when it has been modified. | |
| CURLOPT_HTTPPROXYTUNNEL | When enabled, transfers through an HTTP proxy. | |
| CURLOPT_MUTE | When enabled, restores all modified parameters in cURL functions to their default values. | |
| CURLOPT_NETRC | After the connection is established, access the~/.netrcfile 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 | When enabled, turns off the progress bar for curl transfers. This option is enabled by default.
|
|
| CURLOPT_NOSIGNAL | When enabled, ignores all signals passed by curl to PHP. This option is enabled by default in SAPI multithreaded transfers. | Added in cURL 7.10. |
| CURLOPT_POST | When enabled, sends a regular POST request of type:application/x-www-form-urlencoded, just like a form submission. | |
| CURLOPT_PUT | When enabled, allows HTTP file sending. You must also setCURLOPT_INFILEandCURLOPT_INFILESIZE。 | |
| CURLOPT_RETURNTRANSFER | to return the information obtained by curl_exec() as a file stream instead of outputting it directly. | |
| CURLOPT_SSL_VERIFYPEER | When disabled, cURL will stop verifying from the server. UseCURLOPT_CAINFOoption to set the certificate to useCURLOPT_CAPATHoption to set the certificate directory.CURLOPT_SSL_VERIFYPEERIf (default value is 2) is enabled,CURLOPT_SSL_VERIFYHOSTneeds to be set toTRUEotherwise set toFALSE。 | Since cURL 7.10, the default isTRUE. Bundled and installed by default since cURL 7.10. |
| CURLOPT_TRANSFERTEXT | When enabled, uses ASCII mode for FTP transfers. For LDAP, it retrieves plain text information instead of HTML. On Windows systems, the system will not setSTDOUTit to binary mode. | |
| CURLOPT_UNRESTRICTED_AUTH | When usingCURLOPT_FOLLOWLOCATION, continue to append the username and password information in the multiple locations in the generated header, even if the domain name has changed. | |
| CURLOPT_UPLOAD | When enabled, allows file uploads. | |
| CURLOPT_VERBOSE | When enabled, reports all information and stores it in theSTDERRor the specifiedCURLOPT_STDERR. |
Return Values
Returns TRUE on success, or FALSE on failure.
Other Extensions
PHP cURL Reference Manual