How to use CURL to obtain webpage information

Source: Internet
Author: User
Tags how to use curl gopher
In Baidu Encyclopedia, curl is a file transfer tool that uses the URL syntax to work in the command line mode. Supports many protocols: FTP, FTPS, HTTP, HTTPS, GOPHER, TELNET, DICT, FILE, and LDAP.

Before proceeding to today's topic, let's briefly introduce CRUL.
In Baidu Encyclopedia, curl is a file transfer tool that uses the URL syntax to work in the command line mode. Supports many protocols: FTP, FTPS, HTTP, HTTPS, GOPHER, TELNET, DICT, FILE, and LDAP. (See http://baike.baidu.com/view/1326315.htm)
Here, I will add some functions that CRUL can implement for us: remote retrieval and collection of content, FTP upload and download for PHP web edition, simulated login, and interface connection (API ), data transmission to simulate cookies.
Next, let's start with the simplest remote access to webpage content. if you don't talk about it, paste the code directly:


If an error occurs when running the code, check php. ini to make sure that the CURL extension component is enabled.

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.