PHP – Make a lower case string using mb_strtolower()

In PHP, we can use the function mb_strtolower() to change a given string into lower case. It returns strings with all alphabetic characters converted to lowercase characters, with proper support for multibyte character encodings.

Syntax

string mb_strtolower(string $string, ?string $encoding = null)

Parameters

mb_strtolower() accepts two parameters: $string and $encoding.

  • $string − The string being lowercased, returns strings with all alphabetic characters converted to lowercase characters.

  • $encoding − This parameter is the character encoding. If it is absent or null, then the internal character encoding value will be used.

Return Values

string with all alphabetic characters converted to lowercase.

Example

Here's how to convert a string to lowercase using mb_strtolower() −

<?php
    // Upper and lower case characters are used to
    // convert in lower case using mb_strtolower function
    $string = "Hello World!, Welcome to ONLINE tutorials";

    // It gives the output in lower case
    $string = mb_strtolower($string);
    echo $string;
?>
hello world!, welcome to online tutorials

Example with Encoding

You can also specify the character encoding explicitly −

<?php
    $string = "CAFÉ NAÏVE";
    
    // Convert to lowercase with UTF-8 encoding
    $lowercase = mb_strtolower($string, 'UTF-8');
    echo $lowercase;
?>
café naïve

Conclusion

The mb_strtolower() function is ideal for converting strings to lowercase while preserving multibyte characters. Always specify encoding when working with international characters to ensure proper conversion.

Updated on: 2026-03-15T09:58:06+05:30

598 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements