[SOLVED] XMLWriter vs SimpleXML. Which one is faster?

Issue

I basicly need to load the whole XML file, add a new line with content and then saving it. But I wondered which one is faster.. XMLWriter or SimpleXML? Oh, and, it’s mainly large XML files, more then 10MB.

Thanks!

Solution

As per PHP’s manual, XMLWriter “provides a non-cached, forward-only means of generating streams or files containing XML data.”

It cannot be used to load a document and modify it, therefore it’s not an option and you’re pretty much left with SimpleXML.

Answered By – Josh Davis

Answer Checked By – Mary Flores (BugsFixing Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *