_spaz Posted March 15, 2010 Share Posted March 15, 2010 Can someone please help me parse this XML structure with XMLReader? I'm having issues with the proper syntax i think? XML structure is: <Metadata> <App_Data App="MOD" Name="Title_Brief" Value="Test"/> <App_Data App="MOD" Name="Title" Value="Test12"/> <App_Data App="MOD" Name="Type" Value="title"/> </Metadata PHP code: reader = new XMLReader(); $reader->open($xmlfile); while ($reader->read()) { switch ($reader->nodeType) { case (XMLREADER::ELEMENT): if ($reader->Name == "Title") { $reader->read(); $Title = trim($reader->value); echo $Title; } Link to comment https://forums.phpfreaks.com/topic/195376-xml-reader/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.