(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
コードポイントを表す int 型の値 (例: U+2603 SNOWMAN を表す 0x2603
)、あるいは UTF-8 文字列としてエンコードされた文字 (例: "\u{2603}"
)。
Returns the Unicode code point value as an integer.
例1 さまざまなコードポイントの例
<?php
var_dump(IntlChar::ord("A"));
var_dump(IntlChar::ord(" "));
var_dump(IntlChar::ord("\u{2603}"));
?>
上の例の出力は以下となります。
int(65) int(32) int(9731)