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
https://forums.phpfreaks.com/topic/273646-sanitizing-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.