IntlChar::ord

(PHP 7, PHP 8)

IntlChar::ordReturn Unicode code point value of character

Beschreibung

public static IntlChar::ord ( mixed $character ) : int

Returns the Unicode code point value of the given character.

This function complements IntlChar::chr().

Parameter-Liste

character

Der int-Wert des Codepoints (z.B. 0x2603 für U+2603 SNOWMAN) oder das Zeichen als UTF-8 string kodiert (z.B. "\u{2603}").

Rückgabewerte

Returns the Unicode code point value as an integer.

Beispiele

Beispiel #1 Testen unterschiedlicher Codepoints

<?php
var_dump
(IntlChar::ord("A"));
var_dump(IntlChar::ord(" "));
var_dump(IntlChar::ord("\u{2603}"));
?>

Das oben gezeigte Beispiel erzeugt folgende Ausgabe:

int(65)
int(32)
int(9731)

Siehe auch

  • IntlChar::chr() - Return Unicode character by code point value
  • mb_ord() - Get Unicode code point of character
  • ord() - Konvertiert das erste Byte einer Zeichenkette in einen Wert zwischen 0 und 255

add a note add a note

User Contributed Notes

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