Style & Colour words on a page from RSS feed

Hello,

I have an RSS feed from a 3rd party that I render back to HTML using SimplePie.

In the feed each article title if prefixed by one of the following:

[Severe]
[Medium]
[Slight]

I’d like the words to be colored:

[Severe] to be red and bold
[Medium] to be yellow
[Slight] to be blue

I don’t have any access to the original feed so how can the words be colored and styled?

I’m using php 4.4.2 with Apache

Thank you

You can use a simple replace action:

[php]
$newstr = str_replace("[Severe]", “[Severe]”, $originalFeed);
[/php]

Please read up on the str_replace function in the php.net manual in order to avoid any mistakes I may have made.

Sponsor our Newsletter | Privacy Policy | Terms of Service