Section Phpcurl Code, phpcurl code _php Tutorial

Source: Internet
Author: User

A section of Phpcurl code, 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 ();//page redirection after initializing curl//Allow curl to commitcurl_setopt ($ch, Curlopt_returntransfer, 1); curl_setopt ($ch, Curlopt_followlocation, 1); //returns the header after Curl is committedcurl_setopt ($ch, Curlopt_header, 1); //Recursive fetch locationcurl_setopt ($ch, Curlopt_followlocation, 1); //above processing redirectioncurl_setopt ($ch, Curlopt_url,$url);//Set up linkscurl_setopt ($ch, Curlopt_ssl_verifypeer,FALSE);//HTTPS must be set without authenticationcurl_setopt ($ch, Curlopt_ssl_verifyhost,FALSE);//HTTPS must be set without authenticationcurl_setopt ($ch, Curlopt_returntransfer,TRUE);//set whether to return informationcurl_setopt ($ch, Curlopt_httpheader,$header);//Set HTTP Headers    $html= Curl_exec ($ch);//Receive return informationCurl_close ($ch);

http://www.bkjia.com/PHPjc/1069126.html www.bkjia.com true http://www.bkjia.com/PHPjc/1069126.html techarticle a phpcurl code, Phpcurl code $header [] = ' accept:image/gif, Image/x-xbitmap, Image/jpeg, Image/pjpeg, application/ X-shockwave-flash, text/html, * '. '/* ' ; $header [] = ...

  • 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.