uTools-Manuals/docs/php/mb_strtolower.html
2019-04-28 19:00:34 +08:00

125 lines
6.2 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>使字符串小写</title>
</head>
<body class="docs"><div id="layout">
<div id="layout-content"><div id="function.mb-strtolower" class="refentry">
<div class="refnamediv">
<h1 class="refname">mb_strtolower</h1>
<p class="verinfo">(PHP 4 &gt;= 4.3.0, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">mb_strtolower</span> &mdash; <span class="dc-title">使字符串小写</span></p>
</div>
<div class="refsect1 description" id="refsect1-function.mb-strtolower-description">
<h3 class="title">说明</h3>
<div class="methodsynopsis dc-description">
<span class="methodname"><strong>mb_strtolower</strong></span>
( <span class="methodparam"><span class="type">string</span> <code class="parameter">$str</code></span>
[, <span class="methodparam"><span class="type">string</span> <code class="parameter">$encoding</code><span class="initializer"> = mb_internal_encoding()</span></span>
] ) : <span class="type">string</span></div>
<p class="para rdfs-comment">
返回所有字母字符转换成小写的 <code class="parameter">str</code>
</p>
</div>
<div class="refsect1 parameters" id="refsect1-function.mb-strtolower-parameters">
<h3 class="title">参数</h3>
<p class="para">
<dl>
<dt>
<code class="parameter">str</code></dt>
<dd>
<p class="para">
要被小写的<span class="type"><span class="type 字符串">字符串</span></span>
</p>
</dd>
<dt>
<code class="parameter">encoding</code></dt>
<dd>
<p class="para"><code class="parameter">encoding</code>
参数为字符编码。如果省略,则使用内部字符编码。</p>
</dd>
</dl>
</p>
</div>
<div class="refsect1 returnvalues" id="refsect1-function.mb-strtolower-returnvalues">
<h3 class="title">返回值</h3>
<p class="para">
所有字母字符已被转换成小写的 <code class="parameter">str</code>
</p>
</div>
<div class="refsect1 unicode" id="refsect1-function.mb-strtolower-unicode">
<h3 class="title">Unicode</h3>
<p class="para">
更多关于 Unicode 属性的信息,请参见 <a href="http://www.unicode.org/unicode/reports/tr21/" class="link external">&raquo;&nbsp;http://www.unicode.org/unicode/reports/tr21/</a>
</p>
<p class="para">
<span class="function"><a href="strtolower.html" class="function">strtolower()</a></span> 不同的是,“字母”字符的检测是根据字符的 Unicode 属性。
因此函数的行为不会受语言设置的影响,能偶转换任意具有“字母”属性的字符,例如元音变音 AÄ
</p>
</div>
<div class="refsect1 examples" id="refsect1-function.mb-strtolower-examples">
<h3 class="title">范例</h3>
<p class="para">
<div class="example" id="example-3193">
<p><strong>Example #1 <span class="function"><strong>mb_strtolower()</strong></span> 例子</strong></p>
<div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$str&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"Mary&nbsp;Had&nbsp;A&nbsp;Little&nbsp;Lamb&nbsp;and&nbsp;She&nbsp;LOVED&nbsp;It&nbsp;So"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$str&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mb_strtolower</span><span style="color: #007700">(</span><span style="color: #0000BB">$str</span><span style="color: #007700">);<br />echo&nbsp;</span><span style="color: #0000BB">$str</span><span style="color: #007700">;&nbsp;</span><span style="color: #FF8000">//&nbsp;输出:&nbsp;mary&nbsp;had&nbsp;a&nbsp;little&nbsp;lamb&nbsp;and&nbsp;she&nbsp;loved&nbsp;it&nbsp;so<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
</div>
</div>
</p>
<p class="para">
<div class="example" id="example-3194">
<p><strong>Example #2 非拉丁 UTF-8 文本的 <span class="function"><strong>mb_strtolower()</strong></span> 例子</strong></p>
<div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$str&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"Τάχιστη&nbsp;αλώπηξ&nbsp;βαφής&nbsp;ψημένη&nbsp;γη,&nbsp;δρασκελίζει&nbsp;υπέρ&nbsp;νωθρού&nbsp;κυνός"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$str&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mb_strtolower</span><span style="color: #007700">(</span><span style="color: #0000BB">$str</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'UTF-8'</span><span style="color: #007700">);<br />echo&nbsp;</span><span style="color: #0000BB">$str</span><span style="color: #007700">;&nbsp;</span><span style="color: #FF8000">//&nbsp;输出&nbsp;τάχιστη&nbsp;αλώπηξ&nbsp;βαφής&nbsp;ψημένη&nbsp;γη,&nbsp;δρασκελίζει&nbsp;υπέρ&nbsp;νωθρού&nbsp;κυνός<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
</div>
</div>
</p>
</div>
<div class="refsect1 seealso" id="refsect1-function.mb-strtolower-seealso">
<h3 class="title">参见</h3>
<p class="para">
<ul class="simplelist">
<li class="member"><span class="function"><a href="mb_strtoupper.html" class="function" rel="rdfs-seeAlso">mb_strtoupper()</a> - 使字符串大写</span></li>
<li class="member"><span class="function"><a href="mb_convert_case.html" class="function" rel="rdfs-seeAlso">mb_convert_case()</a> - 对字符串进行大小写转换</span></li>
<li class="member"><span class="function"><a href="strtolower.html" class="function" rel="rdfs-seeAlso">strtolower()</a> - 将字符串转化为小写</span></li>
</ul>
</p>
</div>
</div></div></div></body></html>