63 of 410 menu

The mb_strtolower Function

The mb_strtolower function converts all characters in a string to lowercase, considering the features of multibyte encodings. It accepts a string as the first parameter, and an encoding as the second (optional) one. If the encoding is not specified, the script's internal encoding is used.

Syntax

mb_strtolower(string, [encoding]);

Example

Let's convert a string with Cyrillic characters to lowercase:

<?php echo mb_strtolower('Привет МИР'); ?>

Code execution result:

'привет мир'

Example

Convert a string specifying the UTF-8 encoding:

<?php echo mb_strtolower('HELLO WORLD', 'UTF-8'); ?>

Code execution result:

'hello world'

Example

Comparison with the regular strtolower for multibyte strings:

<?php $str = 'Привет Мир'; echo strtolower($str) . '<br>'; echo mb_strtolower($str, 'UTF-8'); ?>

Code execution result:

'Привет Мир' 'привет мир'

See Also

  • the mb_strtoupper function,
    which converts a string to uppercase
  • the strtolower function,
    which converts a string to lowercase
English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline