function file_get_contents($fn)
{
set_error_handler
(
function($severity, $message, $file, $line)
{
throw new ErrorException($message, $severity, $severity, $file, $line);
}
);
try
{
unset($content);
$content = file_get_contents($fn, true);
}
catch (Exception $e)
{
echo 'Error exception: ', $e->getMessage(), "\n";
return "";
}
return $content;
}
$html = file_get_contents($url);
echo $html;