Geordan Bombos Geordan Bombos - 1 year ago 91
PHP Question

How to change the colour of specific text in PHP

I have got some text that I am wanting to change the colour of that i cant seem to fix for the life of me.

The code is:

echo nl2br ("I was born in: $MEL, $AUS \n" );?>

Now I am wanting to just change the colour of the "I was born in" part of the text.

I understand that you cannot directly change the colour of the text as this is PHP and not HTML but is there a way of doing so with the use of a CSS file.

I hope I am being clear with what i require

Many Thanks in advance

Answer Source

Try this

echo nl2br ("<span style=\"color:red;\">I was born in:</span>  $MEL, $AUS \n" );
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download