컴

mb_convert_case 대소문자변환과 인코딩을 동시에 하기

· 2016-11-10 (목) 14:32:23 · 2730

 

mb_convert_case — 문자열에 케이스 폴딩를 수행

 

[설명]

 

string mb_convert_case ( string $str , int $mode [, string $encoding = mb_internal_encoding() ] )

모드에서 지정한 방식으로 변환 된 문자열에 케이스 폴딩을 수행합니다.

 

[인수]

 

str

문자열은 변환된다.

 

mode

변환의 모드. 그것은 MB_CASE_UPPER, MB_CASE_LOWER, 또는 MB_CASE_TITLE 중 하나가 될 수 있습니다.

 

encoding

encoding 인수는 문자 인코딩입니다. 생략하면, 내부 문자 인코딩값을 사용합니다.

 

[반환값]

 

문자열의 경우 접힌 버전 모드에서 지정한 방식으로 변환됩니다.

 

[유니코드]

 

By contrast to the standard case folding functions such as strtolower() and strtoupper(), case folding is performed on the basis of 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 (Ä).

 

For more information about the Unicode properties, please see » http://www.unicode.org/unicode/reports/tr21/.

 

예제 ¶

 

Example #1 mb_convert_case() example

 

<?php

$str = "mary had a Little lamb and she loved it so";

$str = mb_convert_case($str, MB_CASE_UPPER, "UTF-8");

echo $str; // Prints MARY HAD A LITTLE LAMB AND SHE LOVED IT SO

$str = mb_convert_case($str, MB_CASE_TITLE, "UTF-8");

echo $str; // Prints Mary Had A Little Lamb And She Loved It So

?>

2016/11/10 - [IT/php] - php mb_strtoupper 대문자변환

2016/11/10 - [IT/php] - php mb_strtolower 소문자변환

2016/11/09 - [IT/php] - php strtolower 문자열 소문자 변환

2016/11/09 - [IT/php] - php strripos 문자열 마지막 위치 알아내기

 

|
댓글을 작성하시려면 로그인이 필요합니다.

개발자팁

5,403건

개발과 관련된 유용한 정보를 공유하세요. 질문은 QA에서 해주시기 바랍니다.

+
분류 제목 글쓴이 날짜 조회
기타 16-11-16 조회 4,918
기타 16-11-16 조회 3,296
OS 16-11-16 조회 3,635
PHP 16-11-16 조회 3,048
OS 16-11-16 조회 4,078
PHP 16-11-16 조회 3,266
PHP 16-11-16 조회 2,868
PHP 16-11-15 조회 3,582
PHP 16-11-15 조회 4,199
PHP 16-11-15 조회 3,020
PHP 16-11-14 조회 2,384
PHP 16-11-14 조회 2,617
PHP 16-11-14 조회 2,066
웹서버 16-11-14 조회 5,774
PHP 16-11-13 조회 2,907
웹서버 16-11-13 조회 3,347
PHP 16-11-13 조회 2,930
JavaScript 16-11-12 조회 3,584
기타 16-11-11 조회 2,664
기타 16-11-11 조회 3,020
기타 16-11-11 조회 3,723
PHP 16-11-10 조회 2,731
PHP 16-11-10 조회 2,934
PHP 16-11-10 조회 2,465
기타 16-11-10 조회 2,947
기타 16-11-10 조회 2,789
기타 16-11-10 조회 4,210
PHP 16-11-09 조회 2,699
웹서버 16-11-09 조회 5,694
PHP 16-11-09 조회 2,865