Skip to content

Instantly share code, notes, and snippets.

@tobiastom
Created September 15, 2009 22:28
Show Gist options
  • Save tobiastom/187716 to your computer and use it in GitHub Desktop.
Save tobiastom/187716 to your computer and use it in GitHub Desktop.
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL|E_STRICT);
$xml = <<<XML
<html xmlns:s="http://succont.com">
<head>
<title s:content="title" />
</head>
<body>
<div s:content="content" />
</body>
</html>
XML;
$dom = new DOMDocument;
$dom->loadXML($xml);
$nodeList = $dom->getElementsByTagNameNS('http://succont.com', '*');
for($x = 0; $x < $nodeList->length; $x++) {
var_dump($nodeList->item($x));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment