(PHP 7, PHP 8)
IntlChar::ord — Return Unicode code point value of character
Returns the Unicode code point value of the given character.
This function complements IntlChar::chr().
character
Um codepoint integer (por exemplo 0x2603
para U+2603 SNOWMAN), ou um caracter codificado como uma string UTF-8 (exemplo "\u{2603}"
)
Returns the Unicode code point value as an integer.
Exemplo #1 Testando codepoints diferentes
<?php
var_dump(IntlChar::ord("A"));
var_dump(IntlChar::ord(" "));
var_dump(IntlChar::ord("\u{2603}"));
?>
O exemplo acima irá imprimir:
int(65) int(32) int(9731)