robppc Posted December 19, 2007 Share Posted December 19, 2007 Hello, i am trying to learn Ajax so i picked up a book and started reading. One the the projects in the book is to make a RSS reader. PHP is what grabs the RSS feed and outputs it, and it works pretty much the way it was intended to work with one little problem. When it updates the page element where it dumps the feed, it is outputting the raw html and it is not formatting it at all. Does anyone know what i may be doing wrong? Quote Link to comment Share on other sites More sharing options...
sKunKbad Posted December 26, 2007 Share Posted December 26, 2007 try html_entity_decode(); or if you are using php5 you can use something like this: <?php // Works with php5 only! // KJV verse of the day code starts here ----------------------------------------------------------------------------------------------------------->> print("<div class='greenbox-top'></div> <div class='greenbox-bg'> <h2>Verse Of The Day</h2>"); $feed = simplexml_load_file('http://www.biblegateway.com/usage/votd/rss/votd.rdf?9'); $namespaces = $feed->getNamespaces(true); $content = $feed->channel->item->children($namespaces['content']); $verse = $feed->channel->item->title; echo ("<p>".$verse."<br /><br />".str_ireplace('<br/><br/> Brought to you by <a href="http://www.biblegateway.com">BibleGateway.com</a>. Copyright (C) KJV. All Rights Reserved.','',$content->encoded)."</p>"); print("</div> <div class='greenbox-bottom'></div>"); // KJV verse of the day code ends here -------------------------------------------------------------------------------------------------------------->> ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.