You need to apply the function starts-withto the hrefelement attribute a:). Check out some links and you will get a view, here is the code:
...
$hrefs = $xpath->evaluate("/html/body//a[starts-with(@href, \"http:\")]");
...
Full code:
<?php
$html = file_get_contents('http://mattressandmore.com/in-the-community/');
$dom = new DOMDocument();
@$dom->loadHTML($html);
$xpath = new DOMXPath($dom);
$hrefs = $xpath->evaluate("/html/body//a[starts-with(@href, \"http:\")]");
for ($i = 0; $i < $hrefs->length; $i++) {
$href = $hrefs->item($i);
$url = $href->getAttribute('href');
echo $url.'<br />';
}
?>
img src, "http://" script href.
...
$hrefs = $xpath->evaluate("/html/body//img[starts-with(@src, \"http:\")]");
...