mb_strtolower()

mb_strtolower() — Make a string lowercase.

Built-in function of PHP 8.5. The manual lists it as available in PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.

What it does

Returns string with all alphabetic characters converted to lowercase.

Signature

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

Parameters

ParameterTypeWhat it takes
$stringstringThe string being lowercased.
$encoding?stringThe encoding parameter is the character encoding. If it is omitted or null, the internal character encoding value will be used.

Return value

string with all alphabetic characters converted to lowercase.

Example

A runnable snippet:

$str = "Mary Had A Little Lamb and She LOVED It So"; $str = mb_strtolower($str); echo $str; // Prints mary had a little lamb and she loved it so

Changelog

VersionChange
8.3.0Implemented conditional casing rules for the Greek letter sigma.
8.0.0Now throws a ValueError if encoding is an invalid encoding. Previously, an E_WARNING was emitted and false was returned.

See also

mb_strtoupper(), mb_convert_case(), strtolower()

All PHP 8.5 built-in functions

Reference card built from the PHP manual page mb_strtolower() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.