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;
?>
ascii to decimal to hex
Moderator: General Moderators
-
microthick
- Forum Regular
- Posts: 543
- Joined: Wed Sep 24, 2003 2:15 pm
- Location: Vancouver, BC