ascii to decimal to hex
Posted: Mon Jan 05, 2004 10:59 pm
I am trying to conver a character to decimal then to hex, if I put in a l out of the word hello... the h and e work fine but the l should be 2a and it is coming back as only 2. Anyone know what is wrong? Thanks.
<?
$number = l;
$number = ord($number);
$number = $number - 66;
$number = dechex($number);
echo $number;
?>
<?
$number = l;
$number = ord($number);
$number = $number - 66;
$number = dechex($number);
echo $number;
?>