PHP supports Libcurl (allows you to connect and communicate with different servers in different protocols). , Libcurl currently supports HTTP, HTTPS, FTP, Gopher, Telnet, dict, file, and LDAP protocols. Libcurl also supports HTTPS certificate authorization, HTTP POST, HTTP put, FTP upload (of course you can also use PHP FTP extensions), HTTP basic form uploads, proxies, cookies, and user authentication.
In order to use the Curl function you need to install the Curl package. PHP requires you to use a curl 7.0.2-beta or higher version. If the curl version is lower than the 7.0.2-beta,php will not work.
To use PHP's curl support, you must recompile PHP with the--with-curl[=dir parameter (DIR is the directory that contains the library and header files).
These functions are added to the PHP 4.0.2.
curl_setopt
(PHP 4 >= 4.0.2) curl_setopt--Set an option description for Curl invocation
BOOL curl_setopt (INT-ch, string option, mixed value)
The curl_setopt () function sets the option for a curl session. The option parameter is the setting you want, and value is the values given by this choice.
The values of the following options will be used as long reshaping (specified in the option argument):
Curlopt_infilesize: When you upload a file to a remote site, this option tells PHP the size of the file you uploaded.
Curlopt_verbose: If you want to curl report every unexpected thing, set this option to a value other than 0.
Curlopt_header: If you want to include a header in the output, set this option to a value other than 0.
Curlopt_noprogress: If you don't have PHP to display a process bar for curl transmissions, set this option to a non 0 value.
Note: PHP automatically sets this option to a value other than 0, and you should only change this option for debugging purposes.
Curlopt_nobody: If you don't want to include the body part in the output, set this option to a value other than 0.
Curlopt_failonerror: If you want PHP to be in error (HTTP code returns greater than or equal to 300), do not display, set this option to a person not 0 value. The default behavior is to return a normal page, ignoring the code.
Curlopt_upload: If you want PHP to be ready for upload, set this option to a value other than 0.
Curlopt_post: If you want PHP to do a regular HTTP POST, set this option to a non 0 value. This post is an ordinary application/x-www-from-urlencoded type, most of which is used by HTML forms.
Curlopt_ftplistonly: Set this option to a value other than 0, PHP will list the list of directory names for FTP.
Curlopt_ftpappend: Set this option to a value other than 0, PHP will apply the remote file instead of overwriting it.
CURLOPT_NETRC: Set this option to a value other than 0, PHP will find the username and password of the remote site you want to connect to in your ~./netrc file.
Curlopt_followlocation: Set this option to a non 0 value (like "Location:"), the server will send it as a part of the HTTP header (note that this is recursive, PHP will send the shape as "Location:" the head).
Curlopt_put: Set this option for a non 0 value to upload a file with HTTP. To upload this file, you must set the Curlopt_infile and Curlopt_infilesize options.
Curlopt_mute: Set this option to a value other than 0, PHP will be completely silent for the curl function.
Curlopt_timeout: Sets a long shaping number, as the maximum continuation of how many seconds.
Curlopt_low_speed_limit: Sets a long shaping number to control how many bytes are transferred.
Curlopt_low_speed_time: Set a long shaping number, control how many seconds to transfer curlopt_low_speed_limit The specified number of bytes.
Curlopt_resume_from: Passes a long shaping parameter that contains the byte offset address (the start form you want to transfer to).
Curlopt_sslversion: Passes a long parameter containing the SSL version. The default PHP will be determined by its own efforts, and in more security you must set it manually.
Curlopt_timecondition: Passes a long parameter specifying how to handle the Curlopt_timevalue parameter. You can set this parameter to Timecond_ifmodsince or timecond_isunmodsince. This is for HTTP only.
Curlopt_timevalue: Passes a number of seconds from 1970-1-1 to the present. This time is used by the Curlopt_timevalue option as the specified value or by default timecond_ifmodsince.
The values of the following options will be used as strings: