Parsing the following xml.
http://www.livehindustan.com/home/rssfeed/1.html
i tried with simplepie, but it returns error. Any other custom way to extract the guid, pubDate, bigimage of the items in the xml feed using PHP
Parsing the following xml.
http://www.livehindustan.com/home/rssfeed/1.html
i tried with simplepie, but it returns error. Any other custom way to extract the guid, pubDate, bigimage of the items in the xml feed using PHP
Try this
<?php
$xmlstr = file_get_contents("http://www.livehindustan.com/home/rssfeed/1.html");
$xml = new SimpleXMLElement(trim($xmlstr));
foreach ($xml->channel->item as $item) {
echo 'guid =>', $item->guid, PHP_EOL,
' pubDate => ', $item->pubDate, PHP_EOL,
' bigimage => ', $item->bigimage, PHP_EOL, PHP_EOL;
}
Note: I have used trim($xmlstr) because your feed contains a blank line at the beginning, which is not valid for XML.