What I would do is..
Parse your HTML source of your webpage and then grab all the hyperlinks from the <a>
anchor tags into an array and then do a file_get_contents()
on each of them and detect the response headers and if they are NULL
then the link is down, else the link is up.
Not tested though.. But syntactically correct
<?php
$html= file_get_contents('http://yourwebsite.com/index.html');
$dom = new DOMDocument;
$dom->loadHTML($html);
$links = array();
foreach ($dom->getElementsByTagName('a') as $tag) {
$links[]=$tag->getAttribute('href');
}
foreach($links as $link)
{
@file_get_contents($link);
echo is_null((@$http_response_header)) ? "$link is Down" : "$link is Working";
}