Php functions for obtaining remote webpage content _ PHP Tutorial

Source: Internet
Author: User
Php functions for obtaining remote webpage content .? Php $ curDomain $ _ SERVER [HTTP_HOST]; $ strHTMLfile_get_contents (www. jb51.netDomainParking. asp? GDomName. $ curDomain); echo $ strHTML? I have seen file_get on the Internet. $ CurDomain = $ _ SERVER ['http _ host'];
$ StrHTML = file_get_contents ('http: // www.jb51.net/DomainParking.asp? GDomName = '. $ curDomain );
Echo $ strHTML
?>
I have long seen on the Internet that file_get_contents is unstable and I met it...
On the other hand, it also shows that the program's fault tolerance is very poor...
Well, let's get down to the truth.
This error occurs:
File_get_contents (http: // ***. php): failed to open stream: HTTP request failed!
G, decide to use curl

Http://www.bkjia.com/PHPjc/320507.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/320507.htmlTechArticle? Php $ curDomain = $ _ SERVER ['http _ host']; $ strHTML = file_get_contents ('http: // www.jb51.net/DomainParking.asp? GDomName = '. $ curDomain); echo $ strHTML? File_get...

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.