Home > Article > Backend Development > PHP - Convert string to lowercase using mb_strtolower() function
In PHP we can change a given string to lowercase using the function mb_strtolower(). It returns a string with all alphabetic characters converted to lowercase characters.
string mb_strtolower(str $string, str $encoding)
mb_strtolower()Accepts two parameters: $string and $encoding.
$string− Lowercase string, returns a string with all alphabetic characters converted to lowercase characters.
$encoding− This parameter is the character encoding. If absent or empty, the internal character encoding value will be used.
StringAll alphabetic characters are converted to lowercase.
Live Demonstration
<?php // Upper and lower case characters are used to // convert in lower case using mb_strtoloower function $string = "Hello World!, Welcome to ONLINE tutorials"; // It gives the output in lower case $string = mb_strtolower($string); echo $string; ?>
It converts all characters in the given string to lowercase.
hello world! welcome to online tutorials
The above is the detailed content of PHP - Convert string to lowercase using mb_strtolower() function. For more information, please follow other related articles on the PHP Chinese website!