모든 문자열을 대문자, 소문자로 변환하는 함수 > 기술자료 | 해피정닷컴

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

본문 바로가기

사이트 내 전체검색

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

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건 2 페이지
  • RSS
기술자료 목록
176
PHP   9587  2020-08-06 11:54 ~ 2022-12-14 13:44  
175
PHP   7059  2020-03-04 14:51  
174
PHP   7889  2020-02-25 23:31  
173
PHP   6393  2020-02-22 23:10  
172
PHP   7070  2019-10-28 10:05  
171
PHP   8987  2019-10-02 16:52 ~ 2020-06-05 13:50  
170
PHP   12741  2019-09-27 10:14 ~ 2019-09-27 10:52  
169
PHP   9397  2019-09-24 00:41 ~ 2019-09-24 00:42  
168
PHP   7724  2019-08-26 11:14 ~ 2021-09-20 12:31  
167
PHP   9343  2019-05-02 02:33 ~ 2020-10-12 11:40  
166
PHP   9766  2019-02-13 21:01  
165
PHP   8211  2019-01-31 18:26 ~ 2023-08-09 08:25  
164
PHP   11942  2019-01-23 17:50 ~ 2021-08-26 15:58  
163
PHP   8409  2019-01-23 15:38  
162
PHP   19197  2018-12-12 03:04 ~ 2020-08-06 11:38  
161
PHP   9025  2018-12-03 17:34 ~ 2019-04-19 05:02  
160
PHP   11193  2018-09-30 15:07 ~ 2018-09-30 15:53  
159
PHP   6902  2018-08-29 03:21 ~ 2018-08-29 17:13  
158
PHP   9679  2018-08-20 15:51  
157
PHP   8093  2018-07-26 20:20  

검색

해피정닷컴 정보

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

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