Domanda

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?

È stato utile?

Soluzione

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.

Altri suggerimenti

"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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top