PHP.nl

mb_ord

mb_ord

Get Unicode code point of character

 **mb_ord** string $string  $encoding

Returns the Unicode code point value of the given character.

This function complements . mb_chr

stringA string

encoding The Unicode code point for the first character of return.falseforfailure. string

Voorbeeld: A basic example

<?php
var_dump(mb_ord("A", "UTF-8"));
var_dump(mb_ord("🐘", "UTF-8"));
var_dump(mb_ord("\x80", "ISO-8859-1"));
var_dump(mb_ord("\x80", "Windows-1252"));
?>
int(65)
int(128024)
int(128)
int(8364)

mb_internal_encoding``mb_chr``IntlChar::ord``ord