php里判断一个网站和网页是否能打开,这也是十分重要的技术来的哦,如果出现故障可以及时转移。
<?php
$url=www.xxx.com; //Default isn't 80 port
$fp = fsockopen($url,80);
if(!$fp)
{
echo "有错误,";
}
else
{
echo "正常.";
}
fclose($fp);
?>
<?php
$url=www.xxx.com; //Default isn't 80 port
$fp = fsockopen($url,80);
if(!$fp)
{
echo "有错误,";
}
else
{
echo "正常.";
}
fclose($fp);
?>