Skip to content
Advertisement

How to change attribute value on a simpleXML element?

I parsed a XML file with SimepleXML:

JavaScript

But now I want to append something to the “data” attribute. Not in the file, but in my variables (in the object structure that I got from simplexml_load_file).

How can I do that?

Advertisement

Answer

Untested, but should work:

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