Home >Backend Development >PHP Tutorial >How to convert letters to uppercase and lowercase in php_PHP tutorial
1. Convert the string to lower case
strtolower(): This function converts all characters of the incoming string parameter into lowercase and puts them back into the string in small definite form
2. Convert characters to uppercase
strtoupper(): The function of this function is opposite to the strtolower function. It converts all the characters of the passed character parameter into uppercase and returns the string in uppercase. The usage is the same as strtolowe().
3. Convert the first character of the string to uppercase
ucfirst(): The function of this function is to change the first character of the string to uppercase. This function returns the string with the first character uppercase. The usage is the same as strtolowe().
4. Convert the first character of each word in the string to uppercase
ucwords(): This function changes the first character of each word in the passed string to uppercase. For example, "hello world", after being processed by this function, "Hello Word" will be returned. The usage is the same as strtolowe() Same.