Skip to content
Advertisement

Getting XML node names without duplicating in simplexml_load_file

I’m getting the node names of an XML using this code:

JavaScript

I’m getting the nodes and children correctly, however, it’s duplicating.

Result is as below:

JavaScript

Should I just use array_unique or is there a better method?

Thanks

Advertisement

Answer

i used recursive function this is simple

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement