Linux Curl is a tool for uploading or downloading files under the command line via URL syntax, which supports a variety of protocols such as http,https,ftp,ftps,telnet, which are often used to crawl Web pages and monitor the status of Web Servers.
At first Curl was designed as a command-line tool, and fortunately, PHP also supports curl. By Curl This tool, we can freely send HTTP requests to a URL to obtain or submit data in a PHP program, and support many other protocols, such as
At first Curl was designed as a command-line tool, and fortunately, PHP also supports curl. With curl, we can freely send HTTP requests to a URL to fetch or submit data in a PHP program, and support many other protocols such as Ftp,telnet and SMTP.
Original addressHttp://www.jb51.net/article/48866.htmCurl in PHP Getting Started tutorial and common usage instance fonts: [Increase decrease] type: Reprint
At first Curl was designed as a command-line tool, and fortunately, PHP also supports
1. Open the GZIP requestCurl-i http://www.sina.com.cn/-H accept-encoding:gzip,defalte2, monitoring the response time of the Web pageCurl-o/dev/null-s-W "time_connect:%{time_connect}\ntime_starttransfer:%{time_starttransfer}\ntime_total:%{time_ total}
At first, cURL was designed as a command line tool. Fortunately, php also supports cURL. With cURL, We can freely send HTTP requests to a url in the php program to obtain or submit data, and support other protocols, such as FTP, Telnet, and SMTP. In
First, the advantages of curlYou might say that in PHP you can easily get the content of a URL, as long as through the File_get_contents,file or ReadFile function can be easily implemented, do not have to use the curl:
Copy Code code as
Php curl Getting Started Tutorial and common usage examples. I. Advantages of curl you may say that in php, you can easily obtain the content of a url, as long as the file_get_contents, file, or readfile function can be easily implemented without
At first, cURL was designed as a command line tool. Fortunately, php also supports cURL. Through cURL, we can freely send HTTP requests to a url in the php program to obtain or submit data, and support other protocols, such as FTP and Telnet.
I.
First, Curl's advantagesYou might say that it's easy to get the content of a URL in PHP, as long as it's easy to do with file_get_contents,file or ReadFile functions without using curl at all:
Copy CodeThe code is as follows:
$content =
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.