Jump to content

Assign colors to specific text


Antonella

Recommended Posts

Hi,

I have a question for all you phpers  :)

A friend of mine has made a little php page which read an xml file output by a program.

Now in this file there are numers preceded by this sign '^' what he would like to do is assign each number a different color so that the text following it takes that color

e.g.
^1 = red
^2 = green
etc...
if we have
^1TEXT
this should show
[color=red]TEXT[/color]

so how do we tell php that ^1 = red and that the output should be [code]<font color="red">TEXT</font>[/code] ?

I know this is not clear, if you need to see the pages I'm talking about they're here:
http://warsow.itlanet.net/master.xml
http://warsow.itlanet.net/master.php

thanks for any help  :)
Link to comment
https://forums.phpfreaks.com/topic/29563-assign-colors-to-specific-text/
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.