PHP mb_strtolower() Function

Beginner
5 min read
Updated: Nov 2026
3 examples
mbstring

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.

PHP
$lower = mb_strtolower($text, "UTF-8");
CallWhat 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
PHP
mb_strtolower(string $string, ?string $encoding = null): string

Parameters

ParameterDescription
stringRequired. The text to change.
encodingOptional. The character encoding. Default is the internal encoding.

Return Value

Return ValueDescription
stringThe text with every letter in lowercase.

PHP Examples

Example 1 — Lowercase Accented Text

Compare strtolower() with mb_strtolower().

PHP
<?php
$text = "ÉCOLE";

echo strtolower($text), PHP_EOL;
echo mb_strtolower($text, "UTF-8"), PHP_EOL;

How It Works

  1. Use a word that starts with an accented capital.
  2. strtolower() only changes plain ASCII letters, so É stays.
  3. mb_strtolower() changes every letter, including É.
  4. Use the multibyte version for UTF-8 text.

Example 2 — Lowercase Many Letters

All the accented capitals below become lowercase.

PHP
<?php
echo mb_strtolower("ÀÉÎÕÜ", "UTF-8"), PHP_EOL;
echo mb_strtolower("ПРИВЕТ", "UTF-8"), PHP_EOL;

How It Works

  1. The first line has five accented capitals.
  2. The second line has Cyrillic capitals.
  3. Every letter is converted.
  4. Letters without case, such as digits, would stay as they are.

Example 3 — Compare Without Caring About Case

Lowercase both texts before you compare them.

PHP
<?php
$a = "ÉCOLE";
$b = "école";

var_dump(mb_strtolower($a, "UTF-8") === mb_strtolower($b, "UTF-8"));

How It Works

  1. The two words differ only in case.
  2. Lowercase both with mb_strtolower().
  3. Compare them with ===.
  4. The result is true.

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.

Next: mb_strtoupper()

mb_strtoupper() makes a string uppercase, including accented letters.

mb_strtoupper() tutorial →

CODETOFUN NEWS

Stay Ahead in Tech

Get the latest IT news, programming updates, and technology trends directly on your phone.

Your daily dose of tech, straight to your feed.

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

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