(Solved) ..echo a text with a color stored in a variable?
Posted: Fri Oct 25, 2013 9:08 am
I want a system where the username change with their rating.
I created a if - else if block to store different colorvalues in a variable like:
if (rating = 1) { $usrcolor='#FFFF444'; }
the if block is working... if i echo the $usrcolor variable it shows the correct #?????? value.
Now i want to do something like:
echo "<p style=\"font-color:$usrcolor; \">$username</p>";
but I cannot get it to work.
I think I messed up with the " or forgot some dot (like .$xxx)...
I tried alot of different ways to echo it but either i get it in black color or it wont echo at all..
please help I'm getting seriously frustrated heh.
Thanks
I created a if - else if block to store different colorvalues in a variable like:
if (rating = 1) { $usrcolor='#FFFF444'; }
the if block is working... if i echo the $usrcolor variable it shows the correct #?????? value.
Now i want to do something like:
echo "<p style=\"font-color:$usrcolor; \">$username</p>";
but I cannot get it to work.
I think I messed up with the " or forgot some dot (like .$xxx)...
I tried alot of different ways to echo it but either i get it in black color or it wont echo at all..
please help I'm getting seriously frustrated heh.
Thanks