RSS Links |
[eluser]JanDoToDo[/eluser]
hey guys, i looked through previous posts and found the simplepie lib for rss feeds. However, Im trying to make the title a link and it seems to be replacing all '=' with = and all the '&'with &. The char set is set to utf-8 in simple and utf-8 using the meta on the page. How can i get it to display the characters coz otherwise the link isnt working! I can just change the chars in PHP but it seems like this should already have been thought of so i might be missing something? here is code Code: $this -> simplepie -> set_feed_url($rss_feed['rss_feed']);
[eluser]Phil Sturgeon[/eluser]
Quote:replacing all ‘=’ with = and all the ‘&‘with &. huh? Are you talking about html_entity_decode() or htmlentities()?
[eluser]JanDoToDo[/eluser]
I have no idea! Oh sorry the forums converted the characters - It meant to say: replacing all ‘=’ with '% 3D' and all the ‘&‘ with '% 26' (but without the spaces between % signs) The original link is, e.g. http://www.shef.ac.uk/union/news.php?con...=news-feed but when i get this and then make it a link on my page, the link href is converted to: http://www.shef.ac.uk/union/news.php?contentID'% 3D'8997'% 26'utm_medium'% 3D'RSS'% 26'utm_campaign'% 3D'news-feed Ignore the spaces and apostrophies as obviously it will convert them to the characters if there is no space! I know i could convert the characters myself but it seems like i shouldnt have to?
[eluser]Phil Sturgeon[/eluser]
Looks like you'd be better off trying urldecode()
[eluser]JanDoToDo[/eluser]
Works like a charm thankyou. However,surely I shouldnt have to do this?? Whjy would it be converting the characters in the first place? If I look at the data in the feed it hasnt converted the characters - it only converts when i put the <a href="feed_link" |
Welcome Guest, Not a member yet? Register Sign In |