PHP使用XML的最佳方法是什么?需要创建和解析XML响应 [英] PHP what is the best approach to using XML? Need to create and parse XML responses

查看:72
本文介绍了PHP使用XML的最佳方法是什么?需要创建和解析XML响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在PHP中推荐使用哪些XML库?好处?寻找创建/发送/解析XML.需要支持高流量(每天数百万次通话)

What are the recommended libraries for XML in PHP? Advantages? Looking to create/send/parse XML. Needs to support High Volume (Millions of calls per day)

推荐答案

PHP支持许多如果由于大文件等原因导致内存不足,请使用树基于的解析器必须将文件完全加载到内存中才能解析XML. 基于事件的解析器无需加载将整个文件存入内存以开始解析.

If memory is an issue, for instance due to large files, use an Event-based parser over a tree-based one.Tree-based parsers must fully load the file into memory in order to parse the XML. Event-based parsers do not need to load the entire file into memory to begin parsing.

请参阅有关 PHP5中XML的新功能他们的优缺点的讨论.

您可能还需要重新考虑数据的存储位置,因为文件系统对于数百万次调用可能太慢. Xindice 怎么样?

You might also reconsider where you store the data, since filesystem might be too slow for millions of calls. How about Xindice?

这篇关于PHP使用XML的最佳方法是什么?需要创建和解析XML响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆