모든 문자열을 대문자, 소문자로 변환하는 함수 > 기술자료

본문 바로가기

사이트 내 전체검색

모든 문자열을 대문자, 소문자로 변환하는 함수 > 기술자료

PHP 모든 문자열을 대문자, 소문자로 변환하는 함수

페이지 정보


본문

DEMO 페이지 : https://www.happyjung.com/demo/php/lower_upper.php


1. strtolower
모든 문자열을 소문자로 변환하는 함수 (PHP 4, PHP 5)
string strtolower(string $str)

<?php
$str = "To be, or Not To be, That is the Question";
$str = strtolower($str);
print_r("결과 : ".$str);
?>
결과 : to be, or not to be, that is the question


2. mb_strtolower
인코딩할 문자열을 소문자로 변환하는 함수 (PHP 4 >= 4.3.0, PHP 5)
string mb_strtolower(string $str [, string $encoding= 인코딩방식 ] )

<?php
$str = "To be, or Not To be, That is the Question";
$str = mb_strtolower($str, 'UTF-8');
print_r("결과 : ".$str);
?>
결과 : to be, or not to be, that is the question


3. strtoupper
모든 문자열을 대문자로 변환하는 함수  (PHP 4, PHP 5)
string strtoupper( string $string )

<?php 
$str = "To be, or Not To be, That is the Question";
$str = strtoupper($str);
print_r("결과 : ".$str);
?>
결과 : TO BE, OR NOT TO BE, THAT IS THE QUESTION


4. mb_strtoupper
인코딩할 문자열을 대문자로 변환하는 함수 (PHP 4 >= 4.3.0, PHP 5)
string mb_strtoupper(string $str [, string $encoding= 인코딩방식 ] )

<?php 
$str = "To be, or Not To be, That is the Question";
$str = mb_strtoupper($str, 'UTF-8');
print_r("결과 : ".$str);
?>
결과 : TO BE, OR NOT TO BE, THAT IS THE QUESTION


5. mb_convert_case
문자열을 대,소문자로 변환하는 함수  (PHP 4 >= 4.3.0, PHP 5)
string mb_convert_case(string $str , int $mode= MB_CASE_UPPER [, string $encoding= mb_internal_encoding() ] )
   MB_CASE_UPPER 는 대문자로 변환
   MB_CASE_LOWER 는 소문자로 변환
   MB_CASE_TITLE 은 단어 첫글자만 대문자로 변환

<?php 
$str = "To be, or Not To be, That is the Question";
$str = mb_convert_case($str, MB_CASE_UPPER, 'UTF-8');
print_r("결과 : ".$str);
?>
결과 : TO BE, OR NOT TO BE, THAT IS THE QUESTION

<?php 
$str = "TO BE, OR NOT TO BE, THAT IS THE QUESTION";
$str = mb_convert_case($str, MB_CASE_TITLE, 'UTF-8');
print_r("결과 : ".$str);
?>
결과 : To Be, Or Not To Be, That Is The Question



관련자료
http://blog.habonyphp.com/entry/php-모든-문자열을-대문자-소문자로-변환하는-함수#.W1H2tHsVTAQ
http://mwultong.blogspot.com/2007/06/php-uppercase-lowercase-string.html

댓글목록

등록된 댓글이 없습니다.


Total 196건 4 페이지
  • RSS
기술자료 목록
136
PHP   14365  2017-02-27 19:09 ~ 2020-11-13 14:44  
135
PHP   16807  2017-02-24 16:12  
134
PHP   38297  2016-10-06 22:14 ~ 2018-03-30 14:01  
133
PHP   21392  2016-05-25 11:50 ~ 2022-05-13 11:34  
132
PHP   19439  2016-02-16 17:31  
131
PHP   18897  2015-09-21 14:12  
130
PHP   23428  2015-04-20 09:38 ~ 2021-02-26 16:54  
129
PHP   44688  2015-04-17 03:26  
128
PHP   22724  2015-02-17 23:32  
127
PHP   65724  2015-02-09 09:56 ~ 2023-02-24 11:06  
126
PHP   22707  2014-12-22 15:54  
125
PHP   28051  2014-12-19 06:50 ~ 2019-12-13 10:05  
124
PHP   17554  2014-12-18 13:24 ~ 2021-07-23 14:01  
123
PHP   28039  2014-11-12 10:28 ~ 2021-11-10 07:19  
122
PHP   20051  2014-10-09 09:55 ~ 2015-12-15 00:00  
121
PHP   13614  2014-09-25 15:58 ~ 2018-09-26 14:52  
120
PHP   37563  2014-09-13 13:02 ~ 2022-09-26 20:44  
119
PHP   17997  2014-04-22 02:13  
118
PHP   19162  2014-04-18 19:18  
117
PHP   15683  2014-01-26 21:07 ~ 2014-01-27 00:00  

검색

해피정닷컴 정보

회사소개 회사연혁 협력사 오시는길 서비스 이용약관 개인정보 처리방침

회사명: 해피정닷컴   대표: 정창용   전화: 070-7600-3500   팩스: 042-670-8272
주소: (34368) 대전시 대덕구 대화로 160 대전산업용재유통단지 1동 222호
개인정보보호책임자: 정창용   사업자번호: 119-05-36414
통신판매업신고: 제2024-대전대덕-0405호 [사업자등록확인]  
Copyright 2001~2026 해피정닷컴. All Rights Reserved.