Utf8

A purely static UTF8 Helper based on mb_string and ext-intl. It does nto try to be smart and just fails without mb_string for all string manipulations.

Prerequisites

Utf8 requires mb_string, ext-intl is auto detected and used when available for UTF8 Normalization.

Methods

Signature Description
strrpos(string string $str, string $needle, int $offset = null):int/false UTF8 aware strrpos() replacement
strpos(string $str, string $needle, int $offset = 0):int/false UTF8 aware strpos() replacement
strtolower(string $str):string UTF8 aware strtolower() replacement
strtoupper(string $str):string UTF8 aware strtoupper() replacement
substr(string $str, int $offset, int $length = null):string UTF8 aware substr() replacement
strlen(string $str):int UTF8 aware strlen() replacement
ucfirst(string $str):string UTF8 aware ucfirst() replacement
ucwords(string $str):string UTF8 aware ucwords() replacement
ord(string $chr):int/null UTF8 aware ord() replacement
chr(int $num):string UTF8 aware chr() replacement
normalize(string $string, int $canonicalForm = self::NORMALIZE_NFC):string UTF8 ext-intl Normalizer
hasUtf8(string $string):bool Tells if the input string contains some UTF8
isUtf8(string $string):bool Tells if the input string is valid UTF8
replaceMb4(string $string, string $replace = ''):string Replaces all Utf8Mb4 characters (aka mostly emoji)
normalizerSupport(bool $disable = false):bool Tells if Normalizer is available or disable Normalizer support