Reading XML data in PHP, simple
问题 <?xml version="1.0" encoding="utf-8"?> <mainXML> <items> <item category="Dekorationer" name="Flot væg" description="Meget flot væg. Passer alle stuer." price="149" /> <item category="Fritid" name="Fodbold" description="Meget rund bold. Rørt af messi." price="600" /> </items> </mainXML> How can i read this? So i can make like a php loop that outputs the category, name and description for example? I tried and started out with this: $doc = new DOMDocument(); $doc->load( 'ex.xml' ); $items = $doc