📖
PHP 문자열 대소문자 변환 함수들
페이지 정보
본문
해당 문자열의 알파벳을 소문자나 대문자로 바꾸려고 할 때 사용하는 함수들이다.
물론 해당 알파벳 문자열의 첫 글자만 대문자로 바꿀수 있는 함수도 존재한다.
소문자 변환
strtolower()[code]$temp = "ASDF" ;
$temp = strtolower($temp) ;[/code]출력 : asdf
대문자 변환
strtoupper()[code]$temp = "asdf" ;
$temp = strtoupper($temp);[/code]출력 : ASDF
첫글자만 대문자로
ucfirst()
입력 : "hello world"
출력 : "Hello world"
각 단어의 첫글자를 대문자로
ucwords();
입력 : "hello world"
출력 : "Hello World"
물론 해당 알파벳 문자열의 첫 글자만 대문자로 바꿀수 있는 함수도 존재한다.
소문자 변환
strtolower()[code]$temp = "ASDF" ;
$temp = strtolower($temp) ;[/code]출력 : asdf
대문자 변환
strtoupper()[code]$temp = "asdf" ;
$temp = strtoupper($temp);[/code]출력 : ASDF
첫글자만 대문자로
ucfirst()
입력 : "hello world"
출력 : "Hello world"
각 단어의 첫글자를 대문자로
ucwords();
입력 : "hello world"
출력 : "Hello World"
댓글목록
등록된 댓글이 없습니다.
![]() ![]() |