I work with many different types of xml files. I load the contents of these into my mysql database. Problem is that i need to define the tags I want to pick everytime.
Is there a php dom object functions that can iterate over all the tags and give them to me.
this is my sample xml
<products>
<product>
<name>Name of product</name>
<categories>
<category>Apparel</category>
<category>Trousers</category>
<category>Blue</category>
</categories>
<description>Blue trousers</description>
<price>599.00</price> <regularPrice>599.00</regularPrice>
</product>
</products>
Output should be NOT the values but the acctual name of the XML tags, in this case it should be
Products, Product, Name, Categories, category, description, price
Getting those values I could dynamicly point them via a connection table to always be save in the right table and in the right field.
*Try this code it will work as expected *