How to convert string case in php: You can use strtolower() function and strtoupper() function to achieve string case conversion. The strtolower() function converts a string to lowercase and returns the string converted to lowercase.
In PHP, you can use the strtolower() function and strtoupper() function to achieve string case conversion. Let's introduce these two functions separately.
(Recommended tutorial: php graphic tutorial)
strtolower() function converts the string to lowercase and returns the string converted to lowercase.
Syntax:
strtolower(string)
strtoupper() function converts the string to uppercase and returns the string converted to uppercase.
Grammar:
strtoupper(string)
(Video tutorial recommendation: php video tutorial)
Code example:
Put all Convert characters to uppercase:
<?php echo strtoupper("Hello WORLD!"); ?>
Convert all characters to lowercase:
<?php echo strtolower("Hello WORLD."); ?>
The above is the detailed content of How to convert string case in php. For more information, please follow other related articles on the PHP Chinese website!