Usage of php case-sensitive conversion functions (strtolower and strtoupper)

Source: Internet
Author: User
Tags string back
Usage of php case-sensitive conversion functions (strtolower and strtoupper)
This article describes the usage of the case-sensitive conversion functions strtolower and strtoupper in php, which are frequently encountered in character processing. For more information, see.

1. convert a string to a lower-case strtolower function: This function converts all characters of the input string parameter to lower-case, and puts the string back in a small form. Example:

     

Output: I want to fly

2. convert a character to an upper-case strtoupper function: This function is opposite to the strtolower function. it converts all the characters of the input character parameter to uppercase and returns the string in the upper-case form. The usage is the same as that of strtolower.

Next we will introduce two very useful functions.

3. convert the first character of the string to ucfirst: This function is used to change the first character of the string to uppercase. This function returns the first character of the string in uppercase. The usage is similar to that of the strtolower () function.

4. convert the first character of each word in the string to uppercase: This function converts the first character of each word in the input string to uppercase. For example, "hello world". after this function is processed, "Hello Word" is returned ". The usage is similar to that of strtolower.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.