XML parsing of large amount of data

2020-04-27 07:22发布

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

标签: php xml parsing
4条回答
甜甜的少女心
2楼-- · 2020-04-27 08:17

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.

查看更多
啃猪蹄的小仙女
3楼-- · 2020-04-27 08:21

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.

查看更多
不美不萌又怎样
4楼-- · 2020-04-27 08:26

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

查看更多
不美不萌又怎样
5楼-- · 2020-04-27 08:29

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

查看更多
登录 后发表回答