hi
can someone help me?
I want to find out whether it's possible to determine if a server is available to open a connection to.
e.g. something like this
if ($fp = fopen($url,'r'))
{
while (!feof ($fp)) {
$Document .= fgets($fp, 4096);
}
}
else
{
print( "Error: could not connect to server." );
}
the problem is, if the $url is not active, the script will output errors at the fopen before going to print a nice error message.
what's the best way to fail gracefully in this case?
thanks