Jump to content

Setting the color for an ASCII char


ThunderAI

Recommended Posts

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">

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.