Home >Backend Development >PHP Problem >What function is used to convert string case in php?
In PHP, you can use the strtoupper() and strtolower() functions to convert string case. The strtoupper() function converts a string to uppercase and returns the converted string. The strtolower() function can convert a string to lowercase and return the converted result.
php provides us with functions specifically for converting upper and lower case, such as strtoupper() and strtolower().
(Recommended tutorial: php video tutorial)
Function introduction:
strtoupper() function converts the string to uppercase and Returns a string converted to uppercase.
Example:
<?php echo strtoupper("Hello WORLD!"); ?>
(Related recommendations: php training)
strtolower() function converts the string to lowercase and returns the conversion to lowercase String.
Example:
<?php echo strtolower("Hello WORLD."); ?>
The above is the detailed content of What function is used to convert string case in php?. For more information, please follow other related articles on the PHP Chinese website!