Geordan Bombos Geordan Bombos - 2 months ago 5
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:

<?php
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

Try this

<?php
echo nl2br ("<span style=\"color:red;\">I was born in:</span>  $MEL, $AUS \n" );
?>
Comments