Converts uppercase to lowercase letters

Source: Internet
Author: User
Convert both the client and server in case of uppercase and lowercase. PHP & nbsp; base64 & nbsp; has different encoding methods. for example, if the server is & nbsp; aGVsbG8 = then the client is & nbsp; agvSBg8 = & nbsp; how can I convert the case sensitivity? My current practice is to traverse each byte and convert each other in uppercase and lowercase letters.
Currently, PHP base64 encoding on the client and server is different.
For example, the server is aGVsbG8 =
Then the client is AgvSBg8 = how can I convert the case sensitivity?
My current practice is to traverse the ASCII code of each byte, determine the size, and then decide to add or subtract 32
------ Solution --------------------
Print preg_replace ('/([a-z] *) ([A-Z] *)/E', "strtolower (' \ $2 '). strtoupper ('\ $ 1') ", $ string );

------ Solution --------------------
At the end of this post, xuzuning edited A binary internal code as 01000001 at 11:18:53 on
The binary inCode of a is 01100001.
The space binary inCode is 00100000.

Therefore, letters and spaces are case-insensitive.

It can be seen how intelligent the founder of ASCII code is!
Related Article

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: 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.