I wish to parse the RSS feed in PHP. I first found various third party libraries to do the same namely: Magpie and simplepie.

But since RSS files are in XML format, PHP also has native functions of simplexml_load_file to parse a XML file.

So why should one required the external libraries and not use the native function?

有帮助吗?

解决方案

Using a third party lib which specialized in reading RSS feeds, you will have some methods and properties that SimpleXML has not, because there are implemented into this library.

But if you want to read a simple XML feed, using SimpleXML could be sufficient.

Magpie for example implemented some functions to cache data, for example.

其他提示

"RSS" is a name for four different formats, and there is also Atom that should be supported.

Using a library means you get support for all those formats at once, while you have to implement support for each one separately when doing it manually.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top