mb_strtolower

(PHP 4 >= 4.3.0, PHP 5, PHP 7)

mb_strtolower使字符串小写

说明

mb_strtolower ( string $str [, string $encoding = mb_internal_encoding() ] ) : string

返回所有字母字符转换成小写的 str

参数

str

要被小写的字符串

encoding

encoding 参数为字符编码。如果省略,则使用内部字符编码。

返回值

所有字母字符已被转换成小写的 str

Unicode

更多关于 Unicode 属性的信息,请参见 » http://www.unicode.org/unicode/reports/tr21/

strtolower() 不同的是,“字母”字符的检测是根据字符的 Unicode 属性。 因此函数的行为不会受语言设置的影响,能偶转换任意具有“字母”属性的字符,例如元音变音 A(Ä)。

范例

Example #1 mb_strtolower() 例子

<?php
$str 
"Mary Had A Little Lamb and She LOVED It So";
$str mb_strtolower($str);
echo 
$str// 输出: mary had a little lamb and she loved it so
?>

Example #2 非拉丁 UTF-8 文本的 mb_strtolower() 例子

<?php
$str 
"Τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός";
$str mb_strtolower($str'UTF-8');
echo 
$str// 输出 τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός
?>

参见

相关文章
php 字符串 函数 使一个字符串的第一个字符小写php 多字节字符串 函数 对字符串进行大小写转换php 多字节字符串 函数 转换字符的编码php 多字节字符串 函数 convert kana one from another zen kaku han kaku and more php 多字节字符串 函数 转换一个或多个变量的字符编码php 多字节字符串 函数 解码 mime 头字段中的字符串php 多字节字符串 函数 setup string and regular expression for a multibyte regular expression matchphp 多字节字符串 函数 returns position and length of a matched part of the multibyte regular expression for a predefined multibyte stringphp 多字节字符串 函数 returns the matched part of a multibyte regular expressionphp 多字节字符串 函数 set start point of next regular expression matchphp 多字节字符串 函数 multibyte regular expression match for predefined multibyte stringphp 多字节字符串 函数 解析 get/post/cookie 数据并设置全局变量php 多字节字符串 函数 获取 mime 字符串php 多字节字符串 函数 set/get character encoding for multibyte regexphp 多字节字符串 函数 set/get the default options for mbregex functionsphp 多字节字符串 函数 查找字符串在一个字符串中最后出现的位置php 多字节字符串 函数 查找字符串在另一个字符串里的首次出现php 多字节字符串 函数 使字符串小写php 多字节字符串 函数 使字符串大写php 字符串 函数 转换字符串第一个字节为 0 255 之间的值
关注编程学问公众号