Public feed
#381377
$url = "google.com";
$ch = curl_init("$url");
curl_setopt($ch,
CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch,
CURLOPT_FOLLOWLOCATION, 1);
$output = curl_exec($ch);
if ($output === false || strstr
($output, "HTTP/1.1 404")){//Since server supplies a valid HTML file for missing URLS, also need to look for 404 error in output.
$out['content'] .= "<p>URL $url in the
html mail doesn't appear to exist.</p>";
$badlink = true;
} else {
$out['content'] .= "<p>URL <a
href='$url' target='_new'>$url</a> found</p>";
}
echo $out['content'];