CURLOPT_DNS_CACHE_TIMEOUT
Set the time to save DNS information in memory, the default is 120 seconds.
CURLOPT_FTPSSLAUTH
The FTP authentication method (when is activated): CURLFTPAUTH_SSL (try SSL first), CURLFTPAUTH_TLS (try TLS first), or CURLFTPAUTH_DEFAULT (let cURL decide).
CURLOPT_HTTP_VERSION
Set the HTTP protocol used by curl, CURL_HTTP_VERSION_NONE (let curl judge by itself), CURL_HTTP_VERSION_1_0 (HTTP/1.0), CURL_HTTP_VERSION_1_1 (HTTP/1.1)
CURLOPT_HTTPAUTH
The HTTP verification methods used, optional values are: CURLAUTH_BASIC, CURLAUTH_DIGEST, CURLAUTH_GSSNEGOTIATE, CURLAUTH_NTLM, CURLAUTH_ANY, CURLAUTH_ANYSAFE. You can use the "|" operator to separate multiple values. Curl allows the server to choose a value that supports the best. CURLAUTH_ANY is equivalent to CURLAUTH_BASIC | CURLAUTH_DIGEST | CURLAUTH_GSSNEGOTIATE | CURLAUTH_NTLM, CURLAUTH_ANYSAFE is equivalent to CURLAUTH_DIGEST | CURLAUTH_GSSNEGOTIATE | CURLAUTH_NTLM
CURLOPT_INFILESIZE
Set the size of uploaded files
CURLOPT_LOW_SPEED_LIMIT
When the transmission speed is less than CURLOPT_LOW_SPEED_LIMIT, PHP will determine whether the transmission is cancelled because it is too slow based on CURLOPT_LOW_SPEED_TIME.
CURLOPT_LOW_SPEED_TIME
The number of seconds the transfer should be below CURLOPT_LOW_SPEED_LIMIT for PHP to consider the transfer too slow and abort.
When the transmission speed is less than CURLOPT_LOW_SPEED_LIMIT, PHP will determine whether the transmission is cancelled because it is too slow based on CURLOPT_LOW_SPEED_TIME.
CURLOPT_MAXCONNECTS
The maximum number of connections allowed, exceeding the number of connections will be determined through CURLOPT_CLOSEPOLICY which connections should be stopped.
CURLOPT_MAXREDIRS
Specifies the maximum number of HTTP redirects, this option is used with CURLOPT_FOLLOWLOCATION.
CURLOPT_PORT
An optional number to specify the connection port
CURLOPT_PROXYAUTH
The HTTP authentication method(s) to use for the proxy connection. Use the same bitmasks as described in CURLOPT_HTTPAUTH. For proxy authentication, only CURLAUTH_BASIC and CURLAUTH_NTLM are currently supported.
CURLOPT_PROXYPORT
The port number of the proxy to connect to. This port number can also be set in CURLOPT_PROXY.
CURLOPT_PROXYTYPE
Either CURLPROXY_HTTP (default) or CURLPROXY_SOCKS5.
CURLOPT_RESUME_FROM
Pass a byte offset when resuming transmission (used to continue transmission by breakpoint)
CURLOPT_SSL_VERIFYHOST
1 to check the existence of a common name in the SSL peer certificate.
2 to check the existence of a common name and also verify that it matches the hostname provided.
CURLOPT_SSLVERSION
The SSL version (2 or 3) to use. By default PHP will try to determine this itself, although in some cases this must be set manually.
CURLOPT_TIMECONDITION
If it is edited after a certain time specified by CURLOPT_TIMEVALUE, then use CURL_TIMECOND_IFMODSINCE to return the page. If it has not been modified and CURLOPT_HEADER is true, then a header with "304 Not Modified" is returned. CURLOPT_HEADER is false. Then use CURL_TIMECOND_ISUNMODSINCE, and the default value is CURL_TIMECOND_IFMODSINCE
CURLOPT_TIMEOUT
Set the maximum number of seconds allowed to execute curl
CURLOPT_TIMEVALUE
Set a timestamp used by CURLOPT_TIMECONDITION, and CURL_TIMECOND_IFMODSINCE is used by default.
CURLOPT_CAINFO
The name of a file holding one or more certificates to verify the peer with. This only makes sense when used in combination with CURLOPT_SSL_VERIFYPEER.
CURLOPT_CAPATH
A directory that holds multiple CA certificates. Use this option alongside CURLOPT_SSL_VERIFYPEER.
CURLOPT_COOKIE
Set the content of the "Set-Cookie:" section in the HTTP request.
CURLOPT_COOKIEFILE
The name of the file containing cookie information. This cookie file can be in Netscape format or HTTP-style header information.
CURLOPT_COOKIEJAR
After the connection is closed, the file name that stores the cookie information
CURLOPT_CUSTOMREQUEST
A custom request method to use instead of "GET" or "HEAD" when doing a HTTP request. This is useful for doing "DELETE" or other, more obscure HTTP requests. Valid values are things like "GET", "POST", "CONNECT" and so on; . Do not enter a whole HTTP request line here. For instance, entering "GET / HTTP/1.0\r\n\r\n" would be incorrect.
Note: Don't do this without making sure the server supports the custom request method first.
CURLOPT_EGBSOCKET
Like CURLOPT_RANDOM_FILE, except a filename to an Entropy Gathering Daemon socket.
CURLOPT_ENCODING
The content of the "Accept-Encoding:" part in the header, the supported encoding formats are: "identity", "deflate", "gzip". If set to an empty string, all encoding formats are supported
CURLOPT_FTPPORT
The value which will be used to get the IP address to use for the FTP "POST" instruction. The "POST" instruction tells the remote server to connect to our specified IP address. The string may be a plain IP address, a hostname, a network interface name (under Unix), or just a plain '-' to use the systems default IP address.
CURLOPT_INTERFACE
The name used in an external network interface can be an interface name, IP or host name.
CURLOPT_KRB4LEVEL
The security level setting of KRB4 (Kerberos 4) can be one of the following values: "clear", "safe", "confidential", "private". The default value is "private". When set to null, KRB4 is disabled. Now KRB4 is safe only in FTP transmission.
CURLOPT_POSTFIELDS
"POST" operation in HTTP. If you want to transfer a file, you need a file name starting with @
CURLOPT_PROXY
Set up the HTTP proxy server through
CURLOPT_PROXYUSERPWD
The username and password connected to the proxy server in the format "[username]:[password]".
CURLOPT_RANDOM_FILE
Set the file name of the random number seed used in SSL
CURLOPT_RANGE
To set the HTTP transmission range, you can set a transmission interval in the form of "X-Y". If there are multiple HTTP transmissions, multiple values are separated by commas, such as: "X-Y, N-M".
CURLOPT_REFERER
Set the value of the "Referer:" part in the header.
CURLOPT_SSL_CIPHER_LIST
A list of ciphers to use for SSL. For example, RC4-SHA and TLSv1 are valid cipher lists.
CURLOPT_SSLCERT
Pass a string containing a PEM format certificate.
CURLOPT_SSLCERTPASSWD
Pass a password that contains the required password to use the CURLOPT_SSLCERT certificate.
CURLOPT_SSLCERTTYPE
The format of the certificate. Supported formats are "PEM" (default), "DER", and "ENG".
CURLOPT_SSLENGINE
The identifier for the crypto engine of the private SSL key specified in CURLOPT_SSLKEY.
CURLOPT_SSLENGINE_DEFAULT
The identifier for the crypto engine used for asymmetric crypto operations.
CURLOPT_SSLKEY
The name of a file containing a private SSL key.
CURLOPT_SSLKEYPASSWD
The secret password needed to use the private SSL key specified in CURLOPT_SSLKEY.
Note: Since this option contains a sensitive password, remember to keep the PHP script it is contained within safe.
CURLOPT_SSLKEYTYPE
The key type of the private SSL key specified in CURLOPT_SSLKEY. Supported key types are "PEM" (default), "DER", and "ENG".
CURLOPT_URL
The URL address you need to obtain can also be set in PHP's curl_init() function.
CURLOPT_USERAGENT
Include a string with a "user-agent" header in an HTTP request.
CURLOPT_USERPWD
Pass the username and password required in a connection, in the format: "[username]:[password]".
CURLOPT_HTTP200ALIASES
Settings no longer process HTTP 200 responses in the form of an array.
CURLOPT_HTTPHEADER
Sets an array of contents transferred in a header.
CURLOPT_POSTQUOTE
An array of FTP commands to execute on the server after the FTP request has been performed.
CURLOPT_QUOTE
An array of FTP commands to execute on the server prior to the FTP request.
CURLOPT_FILE
Sets the location of the output file, the value is a resource type, and the default is STDOUT (browser).
CURLOPT_INFILE
The file address that needs to be read when uploading a file is a resource type.
CURLOPT_STDERR
Set an error output address, the value is a resource type, replacing the default STDERR.
CURLOPT_WRITEHEADER
Sets the file address to write to the header part content, the value is a resource type.
CURLOPT_HEADERFUNCTION
Set a callback function, which has two parameters, the first is the resource handle of curl, and the second is the output header data. The output of header data must rely on this function to return the written data size.
CURLOPT_PASSWDFUNCTION
Set a callback function with three parameters. The first is the resource handle of curl, the second is a password prompt, and the third is the maximum allowed password length. Returns the value of the password.
CURLOPT_READFUNCTION
Set a callback function with two parameters. The first is the resource handle of curl and the second is the data read. Data reading must rely on this function. Returns the size of the read data, such as 0 or EOF.
CURLOPT_WRITEFUNCTION
Set a callback function with two parameters, the first is the resource handle of curl and the second is the written data. Data writing must rely on this function. Returns the exact size of the written data
The function of the curl_copy_handle() function is to copy all the content and parameters of a curl connection resource
<?php
$ch = curl_init("/");
$another = curl_copy_handle($ch);
curl_exec($another);
curl_close($another);
?>
The function of the curl_error() function is to return a string containing the error message of the current session.
The function of the curl_errno() function is to return a number containing the error message of the current session.
The function of the curl_multi_init() function is to initialize a curl batch handle resource.
The function of the curl_multi_add_handle() function is to add a separate curl handle resource to the curl batch session. The curl_multi_add_handle() function has two parameters. The first parameter represents a curl batch handle resource, and the second parameter represents a separate curl handle resource.
The function of the curl_multi_exec() function is to parse a curl batch handle. The curl_multi_exec() function has two parameters. The first parameter represents a batch handle resource, and the second parameter is a reference value parameter, indicating the number of remaining single curl handle resources that need to be processed.
The curl_multi_remove_handle() function indicates the removal of a handle resource in the curl batch handle resource. The curl_multi_remove_handle() function has two parameters. The first parameter represents a curl batch handle resource, and the second parameter represents a separate curl handle resource.
The function of the curl_multi_close() function is to close a batch handle resource.
<?php
$ch1 = curl_init();
$ch2 = curl_init();
curl_setopt($ch1, CURLOPT_URL, "/");
curl_setopt($ch1, CURLOPT_HEADER, 0);
curl_setopt($ch2, CURLOPT_URL, "/");
curl_setopt($ch2, CURLOPT_HEADER, 0);
$mh = curl_multi_init();
curl_multi_add_handle($mh,$ch1);
curl_multi_add_handle($mh,$ch2);
do {
curl_multi_exec($mh,$flag);
} while ($flag > 0);
curl_multi_remove_handle($mh,$ch1);
curl_multi_remove_handle($mh,$ch2);
curl_multi_close($mh);
?>
The function of the curl_multi_getcontent() function is to return the text stream of the obtained output when CURLOPT_RETURNTRANSFER is set.
The function of the curl_multi_info_read() function is to obtain the relevant transmission information of the currently parsed curl.
curl_multi_select()
Get all the sockets associated with the cURL extension, which can then be "selected"