November 18, 2015

Convert RSS/XML to an php array

How to convertĀ Convert RSS/XML to an php array ar get RSS feed to your website from another website.

You may need to stay updated for your website but you cant be writing post for your wesite once any product ar post is updated. So you may need to get feed from those website which are providing updated content and provides the feed for their support. You can get those feed and once the content is updated on those website your feed will be automatically updated. This is how you can be stay updated with the latest content/ description without writing your own post or filling product description.

Below code may help you getting this.


$feed = '';
= (array) simplexml_load_file($feed);
//OR $feed_to_array = (array) new SimpleXmlElement( file_get_contents($feed) );


[ShortName] => Stack Overflow
[Description] => Search Stack Overflow: Q&A for professional and enthusiast programmers
[InputEncoding] => UTF-8
[Image] =>
[Url] => SimpleXMLElement Object
[@attributes] => Array
[type] => text/html
[method] => get
[template] =>{searchTerms}



You may also like...

Leave a Reply