Jump to content

[SOLVED] Changing color for echo value?


Leveecius

Recommended Posts

Ok guys, I'm trying to figure out if there is a way to change the color of a echo value.  Here is what I thought it would be for example:

 

if ($mylevel ==2){

echo <font color="orange">"Entertainer"</font>;}

if ($mylevel ==5){

echo <font color="lime">"Help Desk Operator"</font>;}

if ($mylevel ==10){

echo <font color="blue">"Moderator"</font>;}

if ($mylevel ==15){

echo <font color="red">"Administrator"</font>;

 

Is that right or what am I doing wrong?

 

 

Link to comment
https://forums.phpfreaks.com/topic/179614-solved-changing-color-for-echo-value/
Share on other sites

Hi Leveecius,

 

It's just about right, you have your speechmarks in the wrong place though.  CHange your code to read:

 

if ($mylevel ==2){

echo '<font color="orange">Entertainer</font>';}

if ($mylevel ==5){

echo '<font color="lime">Help Desk Operator</font>';}

if ($mylevel ==10){

echo '<font color="blue">Moderator</font>';}

if ($mylevel ==15){

echo '<font color="red">Administrator</font>';

 

Hope this helps.

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.