Files
archived-presentations/slides/php5xml2/dom_access.php
2005-05-16 23:53:57 +00:00

9 lines
261 B
PHP

<?php
$dom = new domDocument(); // create a DOM object
$dom->load(dirname(__FILE__) . "/thedata.xml"); // load data from XML file
/* access elements by tag name */
foreach ($dom->getElementsByTagName('title') as $node) {
echo $node->nodeValue . "<br />";
}
?>