(PHP 5 >= 5.3.0, PHP 7, PHP 8, PECL intl >= 1.0.0)
Normalization is a process that involves transforming characters and sequences of characters into a formally-defined underlying representation. This process is most important when text needs to be compared for sorting and searching, but it is also used when storing text to ensure that the text is stored in a consistent representation.
The Unicode Consortium has defined a number of normalization forms reflecting the various needs of applications:
public static getRawDecomposition(string $string, int $form = Normalizer::FORM_C): ?string
public static isNormalized(string $string, int $form = Normalizer::FORM_C): bool
public static normalize(string $string, int $form = Normalizer::FORM_C): string|false}
The following constants define the normalization form used by the normalizer:
Normalizer::FORM_C int Normalizer::FORM_D int Normalizer::NFD int Normalizer::FORM_KC int Normalizer::NFKC int Normalizer::FORM_KC_CF int Normalizer::FORM_KD int Normalizer::NFKD int Normalizer::NFC int Normalizer::NFKC_CF int | Version | Description |
|---|---|
| 8.4.0 | The class constants are now typed. |
| 8.0.0 | Normalizer::NONE has been removed. |
© 1997–2025 The PHP Documentation Group
Licensed under the Creative Commons Attribution License v3.0 or later.
https://www.php.net/manual/en/class.normalizer.php