如果端口没有响应(错误)到下面的这个脚本,如何添加电子邮件功能发送?
<?php
function test_port($host,$port=80,$timeout=6)
{
$fsock = fsockopen($host, $port, $errno, $errstr, $timeout);
if ( ! $fsock )
{
return FALSE;
}
else
{
return TRUE;
}
}
/* check our website http://www.example.com is up and running (port 80) and timeout after 20 seconds */
$ok = test_port('IP/website',80,20);
?>