August 25th, 2000, 09:43 AM
I looked in the PHP manual and I couldn't find what I was looking for. I need a function that will return the ANSI code value for a character. E.g. "a" should return 97.
In ASP the function is Asc() if that helps anyone (I'm switching from ASP to PHP...) Thanks
August 25th, 2000, 09:52 AM
The function you look for is Ord(string); it returns the ASCII code of the first character of the string.
August 25th, 2000, 09:55 AM
FYI: ASCII codes from 1 to 127 are the same, but above they differ across different operating systems. Use chr() to get character from ASCII code and ord() to go the opposite way.
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
// print lowercase a from ASCII
// print ASCII from lowercase a
<LI> TD Scripts
<LI> Script School
August 26th, 2000, 02:43 PM
Well, I did find those functions, but I guess considering the values above 127 vary I'll have to find out what they are.
What I'm really trying to do is implement an RC4 encryption program into PHP, and that's one of the functions for the encryption.