mb_convert_case
Description
The mb_convert_case of Multibyte String for PHP perform case folding on a string.
Syntax
mb_convert_case( string $string, int $mode, ?string $encoding = null ): string
Parameters
string
The string being converted.
mode
The mode of the conversion. It can be one of:
Constant | Description |
---|---|
MB_CASE_UPPER | UPPERCASE with full case-mapping (multiple characters) |
MB_CASE_LOWER | lowercase with full case-mapping (multiple characters) |
MB_CASE_TITLE | Titlecase with full case-mapping (multiple characters) |
MB_CASE_FOLD | foldcase (caseless) with full case-mapping (multiple characters) |
MB_CASE_UPPER_SIMPLE | UPPERCASE with simple case-mapping (single characters) |
MB_CASE_LOWER_SIMPLE | lowercase with simple case-mapping (single characters) |
MB_CASE_TITLE_SIMPLE | Titlecase with simple case-mapping (single characters) |
MB_CASE_FOLD_SIMPLE | foldcase (caseless) with simple case-mapping (single characters) |
encoding
The encoding parameter is the character encoding. If it is omitted or null, the internal character encoding value will be used.
Return
A case folded version of string converted in the way specified by mode.
Examples
1 · string mode · MB_CASE_UPPER
<? $string = "CASE case Case ß"; $mode = MB_CASE_UPPER; $return = mb_convert_case($string, $mode); echo $return; ?>
CASE CASE CASE SS
2 · string mode · MB_CASE_LOWER
<? $string = "CASE case Case ß"; $mode = MB_CASE_LOWER; $return = mb_convert_case($string, $mode); echo $return; ?>
case case case ß
3 · string mode · MB_CASE_TITLE
<? $string = "CASE case Case ß"; $mode = MB_CASE_TITLE; $return = mb_convert_case($string, $mode); echo $return; ?>
Case Case Case Ss
4 · string mode · MB_CASE_FOLD
<? $string = "CASE case Case ß"; $mode = MB_CASE_FOLD; $return = mb_convert_case($string, $mode); echo $return; ?>
case case case ss
5 · string mode · MB_CASE_UPPER_SIMPLE
<? $string = "CASE case Case ß"; $mode = MB_CASE_UPPER_SIMPLE; $return = mb_convert_case($string, $mode); echo $return; ?>
CASE CASE CASE ß
6 · string mode · MB_CASE_LOWER_SIMPLE
<? $string = "CASE case Case ß"; $mode = MB_CASE_LOWER_SIMPLE; $return = mb_convert_case($string, $mode); echo $return; ?>
case case case ß
7 · string mode · MB_CASE_TITLE_SIMPLE
<? $string = "CASE case Case ß"; $mode = MB_CASE_TITLE_SIMPLE; $return = mb_convert_case($string, $mode); echo $return; ?>
Case Case Case ß
8 · string mode · MB_CASE_FOLD_SIMPLE
<? $string = "CASE case Case ß"; $mode = MB_CASE_FOLD_SIMPLE; $return = mb_convert_case($string, $mode); echo $return; ?>
case case case ß
9 · encoding
<? $string = "CASE case Case ß"; $mode = MB_CASE_UPPER; $encoding = 'UTF-8'; $return = mb_convert_case($string, $mode, $encoding); echo $return; ?>
CASE CASE CASE SS
Links
Multibyte String
- mb_check_encoding
- mb_chr
- mb_convert_encoding
- mb_convert_kana
- mb_convert_variables
- mb_decode_mimeheader
- mb_decode_numericentity
- mb_detect_encoding
- mb_detect_order
- mb_encode_mimeheader
- mb_encode_numericentity
- mb_encoding_aliases
- mb_ereg
- mb_ereg_match
- mb_ereg_replace
- mb_ereg_replace_callback
- mb_ereg_search
- mb_ereg_search_getpos
- mb_ereg_search_getregs
- mb_ereg_search_init
- mb_ereg_search_pos
- mb_ereg_search_regs
- mb_ereg_search_setpos
- mb_eregi
- mb_eregi_replace
- mb_get_info
- mb_http_input
- mb_http_output
- mb_internal_encoding
- mb_language
- mb_list_encodings
- mb_ord
- mb_output_handler
- mb_parse_str
- mb_preferred_mime_name
- mb_regex_encoding
- mb_regex_set_options
- mb_scrub
- mb_send_mail
- mb_split
- mb_str_pad
- mb_str_split
- mb_strcut
- mb_strimwidth
- mb_stripos
- mb_stristr
- mb_strlen
- mb_strpos
- mb_strrchr
- mb_strrichr
- mb_strripos
- mb_strrpos
- mb_strstr
- mb_strtolower
- mb_strtoupper
- mb_strwidth
- mb_substitute_character
- mb_substr
- mb_substr_count