Jay2391 Posted January 24, 2007 Share Posted January 24, 2007 I have this echo statement I want $r_win - $r_loss - $r_tie to be in blue - red and green fonts...can i do that ????[code]echo "<pre>"; printf ("<h5>%-20s%-20s%-20s%-20s%-20s \n", "$r_user_name", "$r_win - $r_loss - $r_tie", "$r_rank", "$r_eliminated", "$r_final_result", "<br></h5>"); echo "</pre>";[/code] Link to comment https://forums.phpfreaks.com/topic/35525-changing-colors/ Share on other sites More sharing options...
Cep Posted January 24, 2007 Share Posted January 24, 2007 You certainly can though its not really anything to do with PHP all you do is attach html elements to either side of your variable and give them a colour. For example,[code=php:0]$text = "my text should be red";echo "<font color='red'>".$text."</font>";[/code]Personally I would use span tags and CSS to do this as I hate font tags but its a quick example. Link to comment https://forums.phpfreaks.com/topic/35525-changing-colors/#findComment-168199 Share on other sites More sharing options...
Jay2391 Posted January 24, 2007 Author Share Posted January 24, 2007 Thanks!!! Link to comment https://forums.phpfreaks.com/topic/35525-changing-colors/#findComment-168221 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.