For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > June 2007 > convert char to BYTE value ?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author convert char to BYTE value ?
Peter

2007-06-12, 7:58 am

Hi,

I'd like to get the actual BYTE value of an ASCII character.

For instance:
$Test = "ABC";
$TestIntValue = Function($Test[0]);

What function would I need to use to get a value of 65 in $TestIntValue ?


iktorn

2007-06-12, 7:58 am

Peter napisał(a):
> Hi,
>
> I'd like to get the actual BYTE value of an ASCII character.
>
> For instance:
> $Test = "ABC";
> $TestIntValue = Function($Test[0]);
>
> What function would I need to use to get a value of 65 in $TestIntValue ?
>
>


Ord is what you're looking for:

http://pl2.php.net/manual/en/function.ord.php

--
Wiktor Walc
http://phpfreelancer.net
Peter

2007-06-12, 7:58 am

Thanks !



>
> Ord is what you're looking for:
>
> http://pl2.php.net/manual/en/function.ord.php
>
> --
> Wiktor Walc
> http://phpfreelancer.net
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com