IntlChar::ord

(PHP 7, PHP 8)

IntlChar::ordReturn Unicode code point value of character

Descrizione

public static IntlChar::ord(int|string $character): ?int

Returns the Unicode code point value of the given character.

This function complements IntlChar::chr().

Elenco dei parametri

character

The int codepoint value (e.g. 0x2603 for U+2603 SNOWMAN), or the character encoded as a UTF-8 string (e.g. "\u{2603}")

Valori restituiti

Returns the Unicode code point value as an integer.

Esempi

Example #1 Testing different code points

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

Il precedente esempio visualizzerĂ :

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

Vedere anche:

  • IntlChar::chr() - Return Unicode character by code point value
  • mb_ord() - Get Unicode code point of character
  • ord() - Restituisce il valore ASCII di un carattere

add a note add a note

User Contributed Notes

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