php
Convert characters to lowercase using strtolower() function in PHP
September 17, 2022
In PHP, the strtolower() function converts all uppercase characters in a string to lowercase. This function is useful for strings that are meant to be case-insensitive, such as email addresses.
<?php
echo strtolower("WORLD IS BEAUTIFUL");
?>
Output
world is beautiful
In the above code example, we have converted all the characters of String "WORLD IS BEAUTIFUL" to lowercase. The PHP function strtolower() will convert all the charters of the string to lowercase. It takes the string as a parameter and returns the same string in the lowercase format.
strtolower($str)
More Examples
Below are the code examples that can help you to better understand the functionality of strtolower() function.
<?php
echo strtolower("We are ProgRammers");
// -> we are programmers
echo strtolower("make the WORLD a Beautiful Place");
// -> make the world a beautiful place
echo strtolower("Hello world");
// -> hello world
?>
Was this helpful?
Similar Posts