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

본문 바로가기

사이트 내 전체검색

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

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 2,648건 21 페이지
  • RSS
기술자료 목록
열람
PHP   10812  2018-07-21 00:10 ~ 2018-07-21 03:56  
2247
그누보드   10620  2018-07-20 20:47 ~ 2018-07-20 21:01  
2246
JSP   9254  2018-07-19 18:57 ~ 2017-10-06 00:00  
2245
JSP   16998  2018-07-19 18:47 ~ 2018-07-26 19:25  
2244
HTML   20088  2018-07-17 18:38 ~ 2020-03-25 18:49  
2243
일반   10791  2018-07-17 17:14 ~ 2018-07-17 17:54  
2242
그누보드   9796  2018-07-17 02:10 ~ 2022-11-15 13:54  
2241
Linux   7472  2018-07-13 18:29  
2240
XpressEngine   7768  2018-07-13 18:22 ~ 2018-07-13 21:51  
2239
MySQL   10345  2018-07-12 12:40 ~ 2018-07-12 12:44  
2238
JavaScript   10636  2018-07-12 00:09  
2237
일반   12564  2018-07-09 17:13 ~ 2018-07-11 17:27  
2236
HTML   7873  2018-07-04 23:27  
2235
HTML   8795  2018-07-04 15:02  
2234
테크노트   10630  2018-07-02 21:39 ~ 2022-04-21 02:58  
2233
Search   12909  2018-07-01 02:38 ~ 2018-07-01 02:41  
2232
일반   9345  2018-06-27 23:32 ~ 2018-07-04 23:09  
2231
그누보드   8110  2018-06-19 14:54  
2230
XpressEngine   10438  2018-06-12 13:08 ~ 2022-04-21 02:49  
2229
XpressEngine   9310  2018-06-11 20:24  

검색

해피정닷컴 정보

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

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