XML parsing of large amount of data

前端 未结 4 1690
广开言路
广开言路 2021-01-23 15:54

Which is the optimal way of XML parsing(XML may be of large amount of data) in php?

相关标签:
4条回答
  • 2021-01-23 16:14

    one of the most common ways is SimpleXML. it's pretty easy to use and fast.

    0 讨论(0)
  • 2021-01-23 16:18

    See XML and PHP 5 in Devzone for a good introduction.

    Basically, if you need to process large volumes of XML files, you will want to use a pull parser, like XMLReader or XMLParser to prevent running into memory issues. Parser like DOM or SimpleXML will read the whole files into memory before you can process them.

    0 讨论(0)
  • 2021-01-23 16:35

    If you need a way to parse XML data that is valid for PHP4 too, then you can use the XML parser, or DOM XML (which is a PHP4 only extensions); if you need a solution for PHP5, then you can use DOM, or XMLReader.

    It depends from your needs.

    0 讨论(0)
  • 2021-01-23 16:37

    i've used SAXY XML parser in the past. try it.

    0 讨论(0)
提交回复
热议问题