ThunderAI Posted August 28, 2010 Share Posted August 28, 2010 I have the following code: $str = ($stringcontents[$step+38]); $str1 = ord($str); $bgcolor = convertchar($str1); ?> <td bgcolor='<?php echo $bgcolor;?>'> <span title='<?php echo $fieldname;?>' style='color: <?php echo $fgcolor;?>; font-size: 12pt'><font color="<?php echo $fgcolor;?>"><?php echo $stringcontents[$step];?></font></span> the convertchar function takes the ord value of the ASCII chr and sets a variable for bgcolor and fgcolor using HTML color codes. The background sets correctly, but the foreground ASCII chr is always black and does not use the font color code. What do I need to do to get the ASCII chr to change to a color other than black? Added: I am using a default charset: <META http-equiv="Content-Type" content="text/html; charset=IBM437"> Quote Link to comment https://forums.phpfreaks.com/topic/211940-setting-the-color-for-an-ascii-char/ Share on other sites More sharing options...
.josh Posted August 28, 2010 Share Posted August 28, 2010 So where in your code do you actually assign a value to $fgcolor? did you look at your output source and see what is actually being output? Quote Link to comment https://forums.phpfreaks.com/topic/211940-setting-the-color-for-an-ascii-char/#findComment-1104582 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.