Question

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!

Was it helpful?

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top