In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces the php transfer lowercase function is what the relevant knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe that everyone after reading this php transfer lowercase function is what the article will have a harvest, let's take a look.
Lowercase functions: 1, strtolower (), syntax "strtolower ($str)"; 2, mb_strtolower (), syntax "mb_strtolower ($str," coding ")"; 3, lcfirst (), syntax "lcfirst ($str)".
Operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer
Php transfer lowercase function
Function name function strtolower converts a string to lowercase lcfirst converts the first letter of a string to lowercase mb_strtolower converts a string to lowercase (different from the strtolower function)
Next, let's introduce them separately.
1) strtolower
The strtolower () function converts letters in a string to lowercase in the following syntax format:
Strtolower ($str)
Where $string is a parameter of type string, and this function converts the letters in the parameter $string to lowercase and returns the converted string.
The sample code is as follows:
The running results are as follows:
2) mb_strtolower
The function of the mb_strtolower () function is similar to the strtolower () function, which can also convert letters in a string to lowercase, and the mb_strtolower () function can also set the character encoding of the parameter. The syntax format is as follows:
Mb_strtolower ($str [, $encoding = mb_internal_encoding ()])
Where $str is the string to be converted and $encoding is an optional parameter that sets the character encoding of the parameter.
Unlike the strtolower () function, the detection of alphabetic characters in $str is based on the character's Unicode attribute. Therefore, the behavior of the function is not affected by the language setting and can convert any character with a "letter" attribute, such as the vowel consonant A.
The sample code is as follows:
The running results are as follows:
3) lcfirst
The lcfirst () function can lowercase the first character of a string in the following syntax format:
Lcfirst ($str)
Where $str is the string to be converted.
The sample code is as follows:
The running results are as follows:
This is the end of the article on "what is the lowercase function of php?" Thank you for reading! I believe that everyone has a certain understanding of the knowledge of "what is the function of php transfer to lowercase". If you want to learn more knowledge, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.