Development Wiki

Function.utf8 clean string

From phpBB Development Wiki

utf8_clean_string –– Clean-up a string


  1. string utf8_clean_string($text)

Makes a clean string of $text. This function is used to generate a "clean" version of the input string.

Clean means that it is a case insensitive form (case folding) and that it is normalized (NFC). Additionally a homographs of one character are transformed into one specific character (preferably ASCII if it is an ASCII character).


Parameter Required Usage
text (string) Yes The text to clean.

Return Values

Cleaned up version of the input string


Please be aware that if you change something within this function or within functions used here you need to rebuild/update the username_clean column in the users table. And all other columns that store a clean string otherwise you will break this functionality.


Example #1

This just explains the function. But is nothing from the phpbb code itself.

echo utf8_clean_string("Fo0b4R");

which returns "fo0b4r"