User Tools

Site Tools


uphp:functions:ord

ord

WMPRO, WMMINI FW >= 1.0 WMMEGA FW >= 2.0

Return the ASCII code for a character

Description

int ord ( string $character )

Parameter

$character: A string containing 1 character

Return Values

Integer: ASCII code number (0-255) of the passed character. If the string length is greater than 1 it will return 0.

Example

<?
  $a=chr(65);
  $o=ord($a);
  print("Character ".$a." has ASCII code ".$o);
?>

See Also

chr() - Return the character for an ASCII code

charat() - Return the ASCII code for a character in a string at an index

uphp/functions/ord.txt · Last modified: 2021/09/13 05:57 (external edit)