The strtolower
method can convert all the alphabetical characters of the string to lowercase characters and returns the modified string as a new string.
strtolower(string $string): string
This method returns a new string. The string passed as the argument remained unchanged.
<?php$str = "TEST_123";$str_lower = strtolower($str);echo "The lowercase value of ". $str. " is ". $str_lower. "\n";$str = "EDUcativE";$str_lower = strtolower($str);echo "The lowercase value of ". $str. " is ". $str_lower. "\n";?>
In the code above, we have used the strtolower
method and converted the strings TEST_123
and EDUcativE
to lowercase strings. The strtolower
will convert.
"TEST_123" to "test_123"
"EDUcativE" to "educative"
Refer here for more details.