Page 1 of 1

RSS to Array PHP?

Posted: Wed Jul 14, 2010 8:48 am
by gblax123
Hey everyone, I am new, and I have a question.

I need to access an RSS, and get the RSS posts into an array.

Is this possible, and if it is, how would I go about doing it?

Here is an example RSS that is exactly like the one I need:
http://services.runescape.com/m=adventu ... ame=Zezima

Thanks if you can help :)

Re: RSS to Array PHP?

Posted: Wed Jul 14, 2010 1:33 pm
by AbraCadaver
That's not an RSS feed, but to answer your question, something like this:

Code: Select all

$rss = (array)simplexml_load_file('feed.rss');
And if you wanted you could loop through and convert the object elements to arrays, but I would just use the whole thing as an object:

Code: Select all

$rss = simplexml_load_file('feed.rss');

Re: RSS to Array PHP?

Posted: Sun Jul 18, 2010 2:21 pm
by josh
It probably would be a RSS feed if we were authenticated. http://framework.zend.com/manual/en/zen ... g-rss.html

Zend will let you treat RSS just like an array.