Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

ord

Returns the Unicode code point of the first character of a string.

Returns the code point of the first character. For an empty string, returns 0. Multi-character strings return only the first character’s code point.

Synopsis

$code = ord("A");       # 65
$code = ord("☺");      # 9786

See Also

chr