Ord

Ord -- Return ASCII value of character.

Description

int ord(string string);

Returns the ASCII value of the first character of string. This function complements chr().

Example 1. Ord() example

  1 
  2 if (ord ($str) == 10) {
  3     echo "The first character of \$str is a line feed.\n";
  4 }
  5       

See also chr().