The mb_strtoupper Function
The mb_strtoupper function converts a string to uppercase,
correctly working with multibyte encodings (for example, UTF-8).
The first parameter is the string to convert, the second (optional) -
is the string encoding.
Syntax
mb_strtoupper(string, [encoding]);
Example
Convert a string to uppercase:
<?php
echo mb_strtoupper('привет');
?>
Code execution result:
'ПРИВЕТ'
Example
Convert a string to uppercase:
<?php
echo mb_strtoupper('abcde');
?>
Code execution result:
'ABCDE'
Example
Convert a string with explicit encoding specification:
<?php
echo mb_strtoupper('äöü', 'UTF-8');
?>
Code execution result:
'ÄÖÜ'
See Also
-
the
mb_strtolowerfunction,
which converts a string to lowercase -
the
strtoupperfunction,
which converts a string to uppercase