Home >Backend Development >PHP Tutorial >How to convert letters to uppercase and lowercase in php_PHP tutorial

How to convert letters to uppercase and lowercase in php_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 09:45:571889browse

PHP letter case conversion method

  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.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1036684.htmlTechArticlephp Letter case conversion method 1. Convert the string to lowercase strtolower(): This function will pass in All characters of the string parameter are converted to lowercase and the character is put back in its diminutive form...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn