A piece of phpcurl code, phpcurl code _ PHP Tutorial

Source: Internet
Author: User
A piece of phpcurl code, phpcurl code. A piece of phpcurl code: phpcurl code $ header [] Accept: imagegif, imagex-xbitmap, imagejpeg, imagepjpeg, applicationx-shockwave-flash, texthtml ,*. *; $ header [] a piece of phpcurl code and phpcurl code
$ Header [] = 'accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, text/html, *'. '/*'; $ header [] = 'Accept-Language: zh-cn'; $ header [] = "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv: 25.0) Gecko/20100101 Firefox/25.0 "; $ ch = curl_init (); // initialize curl // after curl is allowed to be submitted, the webpage redirects curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ ch, CURLOPT_FOLLOWLOCATION, 1); // return curl_setopt ($ ch, CURLOPT_HEADER, 1) for the header submitted by curl ); // recursively crawl LOCATION curl_setopt ($ ch, CURLOPT_FOLLOWLOCATION, 1); // The above process redirects curl_setopt ($ ch, CURLOPT_URL, $ url); // Set the link curl_setopt ($ ch, fail, FALSE); // HTTPS must be set not to verify curl_setopt ($ ch, CURLOPT_SSL_VERIFYHOST, FALSE); // HTTPS must be set not to verify curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, TRUE ); // Set whether to return information curl_setopt ($ ch, CURLOPT_HTTPHEADER, $ header); // Set HTTP header $ html = curl_exec ($ ch ); // receive returned information curl_close ($ ch );

Authorization $ header [] = 'accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, text/html, *'. '/*'; $ header [] =...

Related Article

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.