News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Christian Weiske's Blog:
Importing huge XML files using PHP5 - efficiently and conveniently
August 25, 2008 @ 09:34:38

Christian Weiske has a quick tip on how to get larger XML files to pull into PHP5 and be usable:

At work I had the task to implement the synchronization between an online shop and a commodity management system. Data exchange format was XML - one big XML file for all of the products (some thousands with dozens of attributes). Big question: How do I import the file in a way that is most convenient for me as a programmer - and without exceeding the machine's RAM when loading a 1 GiB file?

The newer alternatives both use the same technology (DOM and SimpleXML - with DOM behind it) so he goes more "low tech" than that and opts for the XMLReader extension to pull in the large amounts of data. Available in PHP5, the XMLReader extension, which he combines with an Iterator from the SPL to makes for a simple, quick little parser.

0 comments voice your opinion now!
import xml file php5 efficient convenient xmlreader spl iterator


blog comments powered by Disqus

Similar Posts

HowTo Forge: How To Harden PHP5 With Suhosin On Fedora 7

Paul Jones' Blog: Memory Leaks With Objects in PHP 5

Shantanu Goel's Blog: Migrating From PHP4 To PHP5: Solving WP-Cache (and maybe other) Issues

Community News: phpDocumentor-13.0RC6 Released

LaughingMeme.com: Looking at PHP5ís DateTime and DateTimeZone


Community Events





Don't see your event here?
Let us know!


package framework introduction opinion install library list symfony interview release update tips series language laravel zendserver deployment podcast api community

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework