Which is the best way to parse an XML file in PHP ?
First
Using the DOM object
//code
$dom = new DOMDocument();
$dom->load(
It depends on the document you're passing, but XMLReader is usually the faster than both simplexml and DOM (http://blog.liip.ch/archive/2004/05/10/processing_large_xml_documents_with_php.html). Personally though I've never used XMLReader and usually decided which to use depending on whether or not I need to edit it:
You can also convert objects between simplexml and DOM.