PHP mb_strtolower() Function

The mb_strtolower() is a PHP inbuilt function that returns lowercase alphanumeric characters.

Syntax:

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

Parameters: This function accepts 2 parameters:

  • string: This parameter specifies the lowercase string.
  • encoding: This parameter denotes the character encoding, & in case omitted or null, then the internal character encoding value will be utilized.

Return value: This function converted the uppercase string into lowercase alphanumeric characters and then returns those characters.

Example 1: The following code shows the working for the mb_strtolower() function.

PHP




<?php
$str = "w3wiki" ;
$str2 = mb_strtolower($str);
echo $str2;
?>


Output:

w3wiki 

Example 2: The following code shows the working for the mb_strtolower() function.

PHP




<?php
$str = "Dmmm" ;
$str2 = mb_strtolower($str);
echo $str2;
?>


Output:

dmmm

Reference: https://www.php.net/manual/en/function.mb-strtolower.php