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