Take the 2-minute tour ×  I have a 5MB xml file  I'm using the
following code to get all nodeValue  $dom        =   new
DomDocument('1.0', 'UTF-8');  $games =
$dom->getElementsByTagName("game"); foreach($games as $game)
This takes 76 seconds and there are around 2000 games tag. Is
there any optimization or other solution to get the data?
share|improve this question I can't imagine optimizing a loop
without knowing what the loop does. –  Herbert Sep 4 '11 at
15:15 look this link [enter link description here][1] [1]:
stackoverflow.com/questions/188414/best-xml-parser-for-php – 
steve Sep 4 '11 at 15:15 @steve: maybe you can elaborate and put
that in the form of an answer. How can SimpleXML speed up the
loop to get at the data? –  Herbert Sep 4 '11 at 15:18 You can
find some useful suggestion in this [link][1] [1]:
stackoverflow.com/questions/188414/best-xml-parser-for-php – 
monish Sep 4 '11 at 15:19 The loop is empty... –  run Sep 4 '11
at 15:19 show 1 more comment  2 Answers  up vote 0 down vote
accepted