PHP头条
热点:

php获取远程网页内容的函数


$curDomain = $_SERVER['HTTP_HOST'];
$strHTML = file_get_contents('http://www.bitsCN.com/DomainParking.asp?gDomName='.$curDomain);
echo $strHTML
?>
早就在网上看到说file_get_contents不稳定,果然碰到了。。。
另一方面也说明了程序的容错性很差啊。。。
恩,言归正传吧。
碰到的是这个错误:
file_get_contents(http://***.php): failed to open stream: HTTP request failed!
G一下,决定用curl

www.phpzy.comtrue/phpyy/15661.htmlTechArticlephp获取远程网页内容的函数 $curDomain = $_SERVER['HTTP_HOST']; $strHTML = file_get_contents('http://www.bitsCN.com/DomainParking.asp?gDomName='.$curDomain); echo $strHTML ?> 早就在网上看到说file_get_contents不稳定,果然...

相关文章

相关频道:

PHP之友评论

今天推荐