(PHP 7)
IntlChar::chr — Return Unicode character by code point value
Returns a string containing the character specified by the Unicode code point value.
This function compliments IntlChar::ord().
codepoint
Valoarea codepoint de tip integer (de ex. 0x2603
pentru U+2603 SNOWMAN) sau caracterul codificat ca
string în UTF-8 (de ex. "\u{2603}"
)
A string containing the single character specified by the Unicode code point value.
Example #1 Testarea diferitor code points
<?php
$values = ["A", 63, 123, 9731];
foreach ($values as $value) {
var_dump(IntlChar::chr($value));
}
?>
Exemplul de mai sus va afișa:
string(1) "A" string(1) "?" string(1) "{" string(3) "☃"