photo gallery
getElementsByTagName() -- Gets elements by tagname // nodeValue : The value of this node, depending on its type. // Load XML File. You can use loadXML if you wish to load XML data from a string $objDOM = new DOMDocument(); $objDOM->load($_SERVER['DOCUMENT_ROOT']."/y2k10/photogallery.xml"); //make sure path is correct $gallery = $objDOM->getElementsByTagName("gallery"); // for each note tag, parse the document and get values for // tasks and details tag. foreach( $gallery as $value ) { $titles = $value->getElementsByTagName("title"); $title = $titles->item(0)->nodeValue; $thumbs = $value->getElementsByTagName("thumb"); $thumb = $thumbs->item(0)->nodeValue; $paths = $value->getElementsByTagName("gallerypath"); $path = $paths->item(0)->nodeValue; echo '
'; echo '
'; echo '
'.$title.'
'; echo ''; echo '
'; } ?>