array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'de', ), 'this' => array ( 0 => 'intlchar.chr.php', 1 => 'IntlChar::chr', ), 'up' => array ( 0 => 'class.intlchar.php', 1 => 'IntlChar', ), 'prev' => array ( 0 => 'intlchar.chartype.php', 1 => 'IntlChar::charType', ), 'next' => array ( 0 => 'intlchar.digit.php', 1 => 'IntlChar::digit', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/intl/intlchar/chr.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 7, PHP 8)
IntlChar::chr — Return Unicode character by code point value
Returns a string containing the character specified by the Unicode code point value.
This function complements IntlChar::ord().
A string containing the single character specified by the Unicode code point value, or null
on failure.
Beispiel #1 Testen unterschiedlicher Codepoints
<?php
$values = ["A", 63, 123, 9731];
foreach ($values as $value) {
var_dump(IntlChar::chr($value));
}
?>
Das oben gezeigte Beispiel erzeugt folgende Ausgabe:
string(1) "A" string(1) "?" string(1) "{" string(3) "☃"