Statement on glibc/iconv Vulnerability

IntlChar::chr

(PHP 7, PHP 8)

IntlChar::chrReturn Unicode character by code point value

Açıklama

public static IntlChar::chr(int|string $codepoint): ?string

Returns a string containing the character specified by the Unicode code point value.

This function complements IntlChar::ord().

Bağımsız Değişkenler

codepoint

int türünde Unicode karakter kodu (örn. U+2603 SNOWMAN için 0x2603) veya string türünde Unicode karakter kodu (örn. "\u{2603}")

Dönen Değerler

A string containing the single character specified by the Unicode code point value, or null on failure.

Örnekler

Örnek 1 Farklı karakter kodlarının denenmesi

<?php
$values
= ["A", 63, 123, 9731];
foreach (
$values as $value) {
var_dump(IntlChar::chr($value));
}
?>

Yukarıdaki örneğin çıktısı:

string(1) "A"
string(1) "?"
string(1) "{"
string(3) "☃"

Ayrıca Bakınız

  • IntlChar::ord() - Return Unicode code point value of character
  • mb_chr() - Unicode karakter koduna göre karakteri döndürür
  • chr() - Bir sayıdan tek baytlık dizge üretir

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top