Friday, May 21, 2010

How can I download an Externall RSS feed from a PHP script?

I need to be able to pull down an external RSS feed into my PHP script for display purposes. What the best site for tutorials on this?

How can I download an Externall RSS feed from a PHP script?
To get the contents of an external site in php, the easiest (though not necessarily most efficient) way to do this is:





$url = ...url to feed...


$contents = file_get_contents($url)





$contents will have the feed contents.





As for a more detailed tutorial on how to parse this feed, check out http://www.phpbuilder.com/columns/ian_gi...





Parsing rss xml in php is not the easiest. If you know how to use xsl, you can create a stylesheet to do the dirty work for you and with the added bonus of having the client browser do the parsing work instead of your server.
Reply:The previous response explained what you need to know and a place to get started. Please select it as best answer.


No comments:

Post a Comment