Definition and Usage
mb_convert_case - the string case conversion
grammar
mb_convert_case( string $str , int $mode [, string $encoding = mb_internal_encoding() ] )
mb_convert_case () to a string case conversion, conversion mode specified by the mode.
parameter
parameter | Necessary | description |
---|---|---|
str | Yes | String is converted to |
mode | Yes | Conversion mode. It can be MB_CASE_UPPER, one of MB_CASE_LOWER and MB_CASE_TITLE. |
encoding | no | encoding parameter is the character code. If omitted, the internal character encoding. |
return value
Mode specified by mode conversion string version of the case.
And the like strtolower () , the strtoupper () is compared to the standard case conversion function, performed according to the underlying case conversion of Unicode character attributes. Thus the behavior of this function is not affected by the locale (the locale) provided, capable of converting an arbitrary character having a "letter" attribute, such as an umlaut A (Ä).
Examples
$str = "mary had a Little lamb and she loved it so"; $str = mb_convert_case($str, MB_CASE_UPPER, "UTF-8"); echo $str; // 输出 MARY HAD A LITTLE LAMB AND SHE LOVED IT SO $str = mb_convert_case($str, MB_CASE_TITLE, "UTF-8"); echo $str; // 输出 Mary Had A Little Lamb And She Loved It So
Related Pages
mb_strtolower () - lowercase character string
mb_strtoupper () - uppercase character string
strtolower () - convert string lowercase
the strtoupper () - convert a string to upper case
ucfirst () - converts the first letter of a string to uppercase
ucwords () - converts the first letter of each word in a string to uppercase