User Tools

Site Tools


uphp:functions:ord

This is an old revision of the document!


ord

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

Return the ASCII character number for a character

Description

int ord ( string $char )

Parameter

$char: string containing 1 character

Return Value

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

Example

<?
  $a=chr(65);
  $o=ord($a);
  print("ASCII Character ".$a." has code ".$o); // result is 'A' which is the ASCII character number 65
?>

See Also

chr() - Return ASCII character for a number</html>

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

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