You are here: Re: ascii to hex « PHP Programming Language « IT news, forums, messages
Re: ascii to hex

Posted by Erwin Moller on 08/04/06 08:51

kuukelekuu@gmail.com wrote:

> I need to convert ascii chars to hex chars.
>
> I searched the internet, found hex to ascii, but nowhere is there a
> ascii to hex method created by anyone.
>
> Can anyone help me with that?
>
> Chears

Hi,

You question is a bit confusing. :-)
hex is nothing more than a 16-base notation.
ascii is definition to declare the first 128 values of a byte to characters
(or more depending on which one you pick).

So that are two different animals.

In PHP:

int -> ascii char : chr()
http://nl2.php.net/manual/en/function.chr.php

ascii -> int : ord()
http://nl2.php.net/manual/en/function.ord.php

Note that the int is 10-base, so you'll have to transform it into hex by
using dexhex() and hexdec() depending on the direction. :-)

Also, this may be of use:
http://www.lookuptables.com/

Hope that helps you going.

Regards,
Erwin Moller

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация