CURL is a tool for connecting and communicating with various servers using various protocols. It is a powerful library that supports http, https, ftp, telnet, file, and other protocols. It also supports HTTPS authentication, HTTPPOST, HTTP
CURL is a tool for connecting and communicating with various servers using various protocols. It is a powerful library that supports http, https, ftp, telnet, file, and other protocols, it also supports HTTPS authentication, http post, http put, FTP upload, HTTP form-based Upload, proxy, cookies, and user name + password authentication.
You may have used the file_get_contents () function, but this approach is insufficient for processing coockies, verification, form submission, and file upload.
The basic method to use cURL is as follows:
First, modify the settings of the php. ini file, find php_curl.dll, and cancel the comment extension = php_curl.dll, because php does not enable cURL by default.
The basic steps are as follows:
1. initialization
2. set the variable (curl_setopt)
3. execute and obtain the result (curl_exec)
4. output
The php instance is as follows::
In the next article, I will describe the detailed usage