how delete node in xml file using php?

How do I load a very large XML file in PHP?

  • I have a very large (90Mb) XML file and I can't get it's data any other way. I'm trying to load it in PHP but due to its size nothing will work. When loading it using DOMDocument, it just fails. Tried using simplexml_load_file as well but it threw a lot of "out of memory" errors. How else could I load it for processing? Cheers

  • Answer:

    PHP has got a SAX parser for XML. SAX lets you chew the XML up bit at a time so you don't have a huge memory burden. Nowhere near as easy as simplexml but worth learning if you have outrageously big files. Or you can hack your PHP.INI if your web hosting allows you. You will find this line that you can change but don't complain to me if your server falls over. memory_limit = 16M ; Maximum amount of memory a script may consume (16MB)

Cam at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.