Phpcurl introduction and basic applications

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.