500 Error: String could not be parsed as XML

singhisking

New Member
I want to get some tags values from XML Feed URL. So i used this code to execute the functionality. But i am struck with this error \[code\]500 Error: String could not be parsed as XML\[/code\].Here is my code.\[code\]for($i=0;$i<count($this->items);$i++) { $feed_url = $this->items[$i]->feed_url; $home_page = file_get_contents($feed_url); $xml = new SimpleXmlElement($home_page); foreach ($xml->channel->item as $entry) { echo $entry->NewsType.'<br>'; echo $entry->title.'<br>'; echo $entry->description.'<br>'; echo $entry->pubDate.'<br>'; }}\[/code\]
  • \[code\]$feed_url\[/code\] => I fetch all feed urls from database.
Important Note:It was working perfect when i am execute this code in a single \[code\]PHP\[/code\] file. But i was getting this error when i used this code into \[code\]Joomla\[/code\] file. Your answers should be appreciated.
 
Back
Top