开发者

PHP function to make text from an RSS feed render properly?

I'm pulling some text from an RSS feed and need to wrap it in a PHP function to get it to render right. The text has been augmented and looks like this:

Reply to this update by 4PM & you're entered to win a pair of tickets to the SOLD OUT 'Twas the Night Before Christmas Tour' featuring Relient K (Acoustic) with Sherwood and Deas Vail show on Friday at 7PM (All Ages). We'll be making our list, checking it twice, etc. at 4PM down in the comments- remember to stop by and see if you've won. Happy Holidays :)<br/><br/><a href="http://www.lincolnhallchicago.com/Shows/12-17-2010+Relient+K+Acoustic" id="" title="" target="" onclick="" style="" onmousedown="UntrustedLink.bootstrap($(this), "ddb14", event);" rel="nofollow"><img class="img" src="http://external.ak.fbcdn.net/safe_image.php?d=a428e785a33b1301e956a69a0b865992&w=90&h=90&url=http%3A%2F%2Fwww.lincolnhallchicago.com%2Fassets%2Froot%2Fimages%2Fartist%2Ficon%2FrelientK.jpg" /></a><br/><a href="http://www.lincolnhallchicago.com/Shows/12-17-2010+Relient+K+Acoustic" id="" target="_blank" style="" onmousedown="UntrustedLink.bootstrap($(this), "ddb14", event);" rel="nofollow">12-17-2010 Relient K Acoustic | Lincoln Hall</a><br/>www.lincolnhallchicago.com<br/>Lincoln Hall 开发者_C百科in Chicago, Illinois - Live Music Nightly

I don't know what to call the formatting of this text, but whatever it is, I don't want it to display this way, I want it to display as properly readable, rendered HTML.

Can someone point me to the right resources? I don't even know what to google. Thanks.


Run it through htmlspecialchars_decode(). Do note, though, that the onmousedown events are probably going to cause JavaScript errors on your page. You might want to create dummy UntrustedLink.bootstrap functions that do nothing.


It looks like it's either been "magic quoted" or someone has run it through urlencode...It's hard to say just looking at the output, because that's all valid HTML (and Javascript. If you don't have those scripts on the page, it shouldn't matter, but their lack will break any Javascript you DO have on the page, so be aware)...How are you looking at it? Are you using a browser, and it looks like the above text?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜