Showing posts with label ascii value. Show all posts
Showing posts with label ascii value. Show all posts

Wednesday, October 1, 2008

The ord() function

The ord() function returns the ASCII value of the first character of the string.

Syntax: ord(string);

string – the input string

Example input:

echo ord("Hello");

Example output:

72

Sunday, September 14, 2008

The chr() function

chr() returns the character corresponding to an ASCII value

Example inputs:

echo chr(100);
echo "
";
echo chr(101);
echo "
";
echo chr(0101);
echo "
";
echo chr(0XFF);