PHP what is the best approach to using XML? Need to create and parse XML responses

PHP supports a number of XML libraries.

If memory is an issue, for instance due to large files, use an Event-based parser over a tree-based one.Tree-based parsers must fully load the file into memory in order to parse the XML. Event-based parsers do not need to load the entire file into memory to begin parsing.

See this article about what’s new with XML in PHP5 and a discussion of their pros and cons.

You might also reconsider where you store the data, since filesystem might be too slow for millions of calls. How about Xindice?

Leave a Comment