PHP Reference · String Functions
PHP mb_strtolower() function
Reference for PHP mb_strtolower(): convert multibyte UTF-8 text to lowercase with full Unicode case mapping, encodings, and the differences from strtolower().
mb_strtolower() converts a string to lowercase according to Unicode rules and a given character encoding. Unlike strtolower(), it understands accented letters, Greek, Cyrillic and many other scripts.
It is part of the mbstring extension. Since PHP 7.3 it uses full case mapping, so a single character may become several, or depend on its neighbors (for example, the Greek capital sigma at the end of a word).
<?php echo mb_strtolower("ÉCOLE"); // école
Try it
Press Run (or Ctrl + Enter) to see the result here.
Program input · what you'd type while the program runs
Type the answers before you press Run, one per line. Each time the program reads a line (with fgets(STDIN)), it gets the next line from this box.
Press Run (or Ctrl + Enter) to see the result here.
Program input · what you'd type while the program runs
Type the answers before you press Run, one per line. Each time the program reads a line (with fgets(STDIN)), it gets the next line from this box.
Syntax
mb_strtolower(string $string, ?string $encoding = null): string
| Name | Description |
|---|---|
$string |
The string to convert. |
$encoding |
Character encoding name such as "UTF-8". null uses the internal encoding (default UTF-8). |
Return value: the lowercase string.
Errors: throws a ValueError if the encoding is not supported.
Usage notes
- Use it for any non-ASCII text.
strtolower()only changesAtoZsince PHP 8.2. - Full case mapping. Some characters change length, so do not assume the result has the same number of characters.
- Not locale-aware. Language-specific rules such as Turkish
Ibecoming dotlessıare not applied. - Case folding for comparison:
mb_convert_case($s, MB_CASE_FOLD)is designed for caseless matching and treatsßandssas equal; plain lowercasing does not. - Requires mbstring; the function does not exist when the extension is missing.
- Invalid byte sequences are not repaired. Check with
mb_check_encoding()first if the input is untrusted. - Pair it with
mb_strtoupper().