Last updated on February 24, 2023
In PHP, the strtolower() function converts all the characters into lowercase. It accepts one parameter and returns the value in the string.
For example, if you pass “LEARN CODING” into the strtolower() function as an argument then it would return “learn coding”.
Syntax
strtolower(string)
Parameters
It has one required parameter that refers to the value which needs to be converted into lowercase.
PHP Supported Version
Usage
You can directly pass the value into the function that needs to be converted.
echo strtolower("LEARN CODING");
// Output: learn coding
Also, it works with variables. So you need to create a variable and store a string.
// save string to variable
$string = "LEARN CODING";
echo strtolower($string);
// Output: learn coding
In this example, we stored a string containing capitalized characters into a variable and passed it into the strtolower() function for converting it into uppercase.