Currently, php provides the most comprehensive CURL description in Chinese. In PHP, the CURL Function Library (ClientURLLibraryFunction) curl_close-closes a curl session curl_copy_handle-copies all content of a curl connection resource and the CURL
Curl Libraries in PHP (Client URL library function)
curl_close-closing a Curl session
curl_copy_handle-Copy all the contents and parameters of a Curl connection resource
curl_errno-returns a numeric number that contains the current session error
Curl function library in PHP (Client URL library function)
Curl_close-closes a Curl session
curl_copy_handle-copies all the contents and parameters of a Curl connection resource
curl_errno-returns a numeric number containing the current session
First, write a simple crawl page function
Copy Code code as follows:
function Getsources ($URL, $User _agent= ', $Referer _url= ')//crawl a specified page
{
$URL page address that needs to be crawled
$User _agent need to return
Curl usage in php CURL Library Function in PHP)
Curl_close? Close a curl sessionCurl_copy_handle? Copy all content and parameters of a curl connection resourceCurl_errno? Returns a number that contains the current session error message.Curl_error?
This article is http://www.51osos.com/a/Linux_CentOS_RedHat/Linuxjichu/2010/1025/curl.html and http://hi.baidu.com/yschen0925/ Summary of the blog/item/d62851072f10eaca7b894790.html.
Today 51 open Source to give you a detailed explanation curl this
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}
When Curl submits a POST request to a website address, it will return a file. If the output will output the content of this file, how can we get the returned file name or how can we save this file? {code ...} $ rinfocurl_getinfo ($ curl); if
Original address: http://blog.sina.com.cn/s/blog_4b9eab320100slyw.html
Can be viewed as a command line browser
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/
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.