Style & Colour words on a page from RSS feed


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:


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:

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

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

Sponsor our Newsletter | Privacy Policy | Terms of Service