Recommended: "PHP Tutorial"
strtoupper( ), strtolower(), ucfirst(), ucfirst(), ucwords(), mb_strtoupper(), mb_strtolower() and mb_convert_case() The differences and connections between the eight functions:
Function name |
Usage scope |
Function |
##strtoupper |
PHP4 、PHP5 |
Convert the string to uppercase |
strtolower |
PHP4、PHP5 |
Convert the string to Lowercase |
ucfirst |
##PHP4、PHP5 |
Convert the first letter of the string to uppercase |
lcfirst |
PHP5>= 5.3.0 |
Convert the first letter of the string to lowercase |
ucwords |
PHP4、PHP5 |
Replace each string in The first character of a word is converted to upper case |
##mb_strtoupper |
PHP4>=4.3.0,PHP 5 |
Convert the string to uppercase (with the strtoupper function There is a difference) |
##mb_strtolower
| ##PHP4>=4.3 .0,PHP 5
##Convert the string to lowercase (different from the | strtolower function)
|
PHP4>=4.3.0,PHP 5 |
Convert strings according to different modes |