1.

How To Convert A Character To An Ascii Value?

Answer»

If you want to convert characters to ASCII values, you can USE the ORD() function, which takes the first charcter of the specified string, and returns its ASCII value in DECIMAL format. ord() COMPLEMENTS chr(). Here is a PHP script on how to use ord():
<?php
print(ord("Hello")."\n");
print(chr(72)."\n");
?>
This script will print:
72
H

If you want to convert characters to ASCII values, you can use the ord() function, which takes the first charcter of the specified string, and returns its ASCII value in decimal format. ord() complements chr(). Here is a PHP script on how to use ord():
<?php
print(ord("Hello")."\n");
print(chr(72)."\n");
?>
This script will print:
72
H



Discussion

No Comment Found