PHP mb_strtolower() Function

Definition
In PHP, mb_strtolower() changes every letter in a string to lowercase, including accented letters and other scripts.
Plain strtolower() only handles basic English letters, so use this one for UTF-8 text.
Syntax
Call mb_strtolower() with the values you need. Start with this line.
$lower = mb_strtolower($text, "UTF-8");
| Call | What it does |
|---|
mb_strtolower("ÉCOLE", "UTF-8") | Returns "école". |
mb_strtolower("HELLO", "UTF-8") | Returns "hello". |
Letters that have no lowercase form, such as digits, stay as they are.
Library declarations
mb_strtolower(string $string, ?string $encoding = null): string
Parameters
| Parameter | Description |
|---|
| string | Required. The text to change. |
| encoding | Optional. The character encoding. Default is the internal encoding. |
Return Value
| Return Value | Description |
|---|
| string | The text with every letter in lowercase. |
PHP Examples
Example 1 — Lowercase Accented Text
Compare strtolower() with mb_strtolower().
<?php
$text = "ÉCOLE";
echo strtolower($text), PHP_EOL;
echo mb_strtolower($text, "UTF-8"), PHP_EOL;
How It Works
- Use a word that starts with an accented capital.
- strtolower() only changes plain ASCII letters, so
É stays. - mb_strtolower() changes every letter, including
É. - Use the multibyte version for UTF-8 text.
Example 2 — Lowercase Many Letters
All the accented capitals below become lowercase.
<?php
echo mb_strtolower("ÀÉÎÕÜ", "UTF-8"), PHP_EOL;
echo mb_strtolower("ПРИВЕТ", "UTF-8"), PHP_EOL;
How It Works
- The first line has five accented capitals.
- The second line has Cyrillic capitals.
- Every letter is converted.
- Letters without case, such as digits, would stay as they are.
Frequently Asked Questions
mb_strtolower() converts a string to lowercase and handles accented letters and non-English scripts.
mb_strtolower(string $string, ?string $encoding = null): string.
strtolower() only changes basic ASCII letters. mb_strtolower() changes letters in every script it knows.
It follows the Unicode case rules, so most scripts with letter case work. Some languages have special rules that may need extra care.
mb_strtoupper() makes every letter uppercase.
CODETOFUN NEWS
Stay Ahead in Tech
Get the latest IT news, programming updates, and technology trends directly on your phone.
About the author
Developer, cloud engineer, and technical writer
I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.
8 people found this page helpful