Skip to content

Instantly share code, notes, and snippets.

@LeffeBakedBird
Last active September 5, 2017 13:29
Show Gist options
  • Save LeffeBakedBird/cf71f97777f12f797e1ff0634b29d018 to your computer and use it in GitHub Desktop.
Save LeffeBakedBird/cf71f97777f12f797e1ff0634b29d018 to your computer and use it in GitHub Desktop.
<?php
$urls = array();
$DomDocument = new DOMDocument();
$DomDocument->load('sitemap.xml');
$DomNodeList = $DomDocument->getElementsByTagName('loc');
foreach($DomNodeList as $url) {
echo $url->nodeValue;
$headers = get_headers($url->nodeValue);
$code = $headers[0];
echo $code;
echo "<br />";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment