I have a XML file with 6 category. I need help to parse XML node into PHP and have an id for each of the node.
—catalog.xml—
<?xml version="1.0" encoding="ISO-8859-1"?>
<Catalog>
<Category><Name>CAT1</Name></Category>
<Category><Name>CAT2</Name></Category>
<Category><Name>CAT3</Name></Category>
<Category><Name>CAT4</Name></Category>
<Category><Name>CAT5</Name></Category>
<Category><Name>CAT6</Name></Category>
</Catalog>
—catalog.xml—
The first node based on array would be an id [0] and subsequent [1], [2], [3], [4], [5]
When I browse it should be still CAT1, CAT2, CAT3…but their id is already created within the coding.
Many thanks.
No need to fake it. Just do the hard way.