array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'function.mb-strtolower.php', 1 => 'mb_strtolower', ), 'up' => array ( 0 => 'ref.mbstring.php', 1 => '多字节字符串 函数', ), 'prev' => array ( 0 => 'function.mb-strstr.php', 1 => 'mb_strstr', ), 'next' => array ( 0 => 'function.mb-strtoupper.php', 1 => 'mb_strtoupper', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'zh', 'path' => 'reference/mbstring/functions/mb-strtolower.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8)
mb_strtolower — 使字符串小写
所有字母字符已被转换成小写的 string
。
示例 #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
?>
示例 #2 非拉丁 UTF-8 文本的 mb_strtolower() 例子
<?php
$str = "Τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός";
$str = mb_strtolower($str, 'UTF-8');
echo $str; // 输出 τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός
?>
和 strtolower() 不同的是,“字母”字符的检测是根据字符的 Unicode 属性。因此函数的行为不会受语言设置的影响,能偶转换任意具有“字母”属性的字符,例如元音变音 A(ä)。
更多关于 Unicode 属性的信息,请参见 » http://www.unicode.org/reports/tr21/。