Jump to content

Sanitizing help


laptopu

Recommended Posts

Hello, I am wondering if someone can help me sanitize an RSS feed I am parsing please? I am not really a good coder I will admit so any help is appreciated.

 

I am trying to display an RSS feed on an IP handset which displays plain text. Using a weather feed there is a degree symbol in the feed which shows up as ?? on the handset.

 

The feed I am using is here:

 

http://open.live.bbc.co.uk/weather/feeds/en/2643743/observations.rss

 

And here is the script I have so far:

 

<?PHP

getFeed('http://open.live.bbc.co.uk/weather/feeds/en/2643743/observations.rss');

function getFeed($feed_url) {

$content = file_get_contents($feed_url);

$x = new SimpleXmlElement($content);

foreach($x->channel->item as $entry) {

//$pgtitle = "<li><a href='$entry->link' title='$entry->title'>" . $entry->title . "</a></li>";

echo "" . $entry->title . "";

echo "

";

echo "" . $entry->description . "";

}

}

?>

 

I have read a lot about sanitizing tags but I have tried inserting them in lots of different ways but the degree symbol always appears. Can anyone tell me what I need to do to my code please?

 

Thanks for your help in advance.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.