Below is XML format
:
<item>
<title>Lorem ipsum</title>
<link>http://www.website.com</link>
<pubDate>Sun, 30 Aug 2015 16:51:18 +0000</pubDate>
<description>
<![CDATA[Dummy text Dummy text Dummy text]]>
</description>
<title>Lorem ipsum test</title>
<link>http://www.test.com</link>
<pubDate>Sun, 29 Aug 2015 16:51:18 +0000</pubDate>
<description>
<![CDATA[Dummy text test Dummy text test Dummy text test]]>
</description>
</item>
What i have tried:
<?php
$rss = file_get_contents('<URL>');
$xml = new SimpleXMLElement($rss);
foreach($xml->channel->item as $feed){
$title = $feed->title;
$added_date_time = date("Y-m-d H:i:s", strtotime($date));
$description = $feed->description;
print_r($title);
print_r($description);
}
?>
it is giving me this output for description:
SimpleXMLElement Object ( [0] => SimpleXMLElement Object ( ) )
How can i get description data?