I have this code:
$dom = new DOMDocument(); $dom->load(\'file.xml\'); $names = $dom->getElementsByTagName(\'name\');
N
Assuming you want the actual values and not to create an array of DOM nodes:
foreach($nodelist as $node) { $values[] = $node->nodeValue; }