Parsing an XML with Xpath in PHP

alletgainty

New Member
Consider the following code :\[code\]$dom = new DOMDocument();$dom->loadXML($file);$xmlPath = new DOMXPath($dom);$arrNodes = $xmlPath->query('*/item');foreach($arrNodes as $item){//missing code}\[/code\]The $file is an xml and each item has a title and a description.How can I display them (title and description)?\[code\]$file = "<item> <title>test_title</title> <desc>test</desc></item>";\[/code\]
 
Back
Top