How to Change All Capital Letters/uppercases to All Lowercases in a String in PHP?

Problem:

You have a string which has all the letters in capital letters or first letters of each word in capital letters or few letters in any positions in capital letters. You want to convert each letter of the whole string to lowercase.

Solution:

To make all the characters of a string lowercase, use mb_strtolower() function. This function converts all the alphabetic characters to lowercase.

See the following example-

<?php
$string = "Nine People Can not Make A Baby in A Month.";
echo "Original string: ". $string. "<br />";
$string = mb_strtolower($string);
echo "Converted string: ". $string;
?>

[wpdm_file id=136]

Output:
Original string: Nine People Can not Make A Baby in A Month.Converted string: nine people can not make a baby in a month.