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] Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Jay2391 Posted January 24, 2007 Author Share Posted January 24, 2007 Thanks!!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.