Re: hex to ascii equivalent
| From: | David Robley | Date: | Wed, 23 Aug 2000 01:24:38 +0000 |
| Subject: | Re: hex to ascii equivalent | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-13056@lists.php.net to get a copy of this message | ||
On 22 Aug, Jason Stechschulte wrote:
> Is there an easy way to convert 2 hex digits to their ascii
> equivalent? I currently have things like the following.
>
> $hex[0] = 0x03
> $hex[1] = 0x0d
> $hex[2] = 0x5e
>
> I would like to get the character that these codes represent. Is
> there an easy way to do this?
>
> Jason Stechschulte
> jpstech@nc.edu
>
>
What about using hexdec() to convert to decimal, and then chr() to get
the character?
Cheers
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA