Valori restituiti

Unicode

By contrast to strtoupper(), '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 (ä).

Esempi

Example #1 mb_strtoupper() example

<?php$str = "Mary Had A Little Lamb and She LOVED It So";$str = mb_strtoupper($str);echo $str; // Prints MARY HAD A LITTLE LAMB AND SHE LOVED IT SO?>

User Contributed Notes 2 notes

Please note, that in many cases, forcing UTF-8 encoding with second parameter is necessary. PHP documentation states that if this parameter is omitted, the internal character encoding value will be used. But in my case it turned out to be not true. Even though I have all my pages encoded in UTF-8 and my DB connection set to force UTF-8 encoding, comparison of user-input and DB-retrieved data, which is using mb_strtoupper, did not work until I forced encoding.

mb_strtoupper() will not convert the German "ß" character into its (relatively new) uppercase form ("ẞ").mb_strtolower() will, however, convert the uppercase form into a lowercase "ß". (tested with PHP 5.5.0)"SS" is still the most common uppercase presentation of "ß". If you want this, you'll have to do it manually: