<!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>Make a string lowercase</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.mb-strstr.html">mb_strstr</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.mb-strtoupper.html">mb_strtoupper</a></div> <div class="up"><a href="ref.mbstring.html">Multibyte String Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="function.mb-strtolower" class="refentry"> <div class="refnamediv"> <h1 class="refname">mb_strtolower</h1> <p class="verinfo">(PHP 4 >= 4.3.0, PHP 5)</p><p class="refpurpose"><span class="refname">mb_strtolower</span> — <span class="dc-title">Make a string lowercase</span></p> </div> <div class="refsect1 description" id="refsect1-function.mb-strtolower-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">string</span> <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> ] )</div> <p class="para rdfs-comment"> Returns <em><code class="parameter">str</code></em> with all alphabetic characters converted to lowercase. </p> </div> <div class="refsect1 parameters" id="refsect1-function.mb-strtolower-parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><em><code class="parameter">str</code></em></span> <dd> <p class="para"> The <span class="type"><a href="language.types.string.html" class="type string">string</a></span> being lowercased. </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">encoding</code></em></span> <dd> <p class="para">The <em><code class="parameter">encoding</code></em> parameter is the character encoding. If it is omitted, the internal character encoding value will be used.</p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-function.mb-strtolower-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> <em><code class="parameter">str</code></em> with all alphabetic characters converted to lowercase. </p> </div> <div class="refsect1 unicode" id="refsect1-function.mb-strtolower-unicode"> <h3 class="title">Unicode</h3> <p class="para"> For more information about the Unicode properties, please see <a href="http://www.unicode.org/unicode/reports/tr21/" class="link external">» http://www.unicode.org/unicode/reports/tr21/</a>. </p> <p class="para"> By contrast to <span class="function"><a href="function.strtolower.html" class="function">strtolower()</a></span>, 'alphabetic' is determined by the Unicode character properties. Thus the behaviour of this function is not affected by locale settings and it can convert any characters that have 'alphabetic' property, such as A-umlaut (Ä). </p> </div> <div class="refsect1 examples" id="refsect1-function.mb-strtolower-examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example" id="example-2719"> <p><strong>Example #1 <span class="function"><strong>mb_strtolower()</strong></span> example</strong></p> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"> <span style="color: #0000BB"><?php<br />$str </span><span style="color: #007700">= </span><span style="color: #DD0000">"Mary Had A Little Lamb and She LOVED It So"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$str </span><span style="color: #007700">= </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 </span><span style="color: #0000BB">$str</span><span style="color: #007700">; </span><span style="color: #FF8000">// Prints mary had a little lamb and she loved it so<br /></span><span style="color: #0000BB">?></span> </span> </code></div> </div> </div> </p> <p class="para"> <div class="example" id="example-2720"> <p><strong>Example #2 <span class="function"><strong>mb_strtolower()</strong></span> example with non-Latin UTF-8 text</strong></p> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"> <span style="color: #0000BB"><?php<br />$str </span><span style="color: #007700">= </span><span style="color: #DD0000">"Τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$str </span><span style="color: #007700">= </span><span style="color: #0000BB">mb_strtolower</span><span style="color: #007700">(</span><span style="color: #0000BB">$str</span><span style="color: #007700">, </span><span style="color: #DD0000">'UTF-8'</span><span style="color: #007700">);<br />echo </span><span style="color: #0000BB">$str</span><span style="color: #007700">; </span><span style="color: #FF8000">// Prints τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός<br /></span><span style="color: #0000BB">?></span> </span> </code></div> </div> </div> </p> </div> <div class="refsect1 seealso" id="refsect1-function.mb-strtolower-seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"> <span class="function"><a href="function.mb-strtoupper.html" class="function" rel="rdfs-seeAlso">mb_strtoupper()</a> - Make a string uppercase</span></li> <li class="member"> <span class="function"><a href="function.mb-convert-case.html" class="function" rel="rdfs-seeAlso">mb_convert_case()</a> - Perform case folding on a string</span></li> <li class="member"> <span class="function"><a href="function.strtolower.html" class="function" rel="rdfs-seeAlso">strtolower()</a> - Make a string lowercase</span></li> </ul> </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.mb-strstr.html">mb_strstr</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.mb-strtoupper.html">mb_strtoupper</a></div> <div class="up"><a href="ref.mbstring.html">Multibyte String Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>