Strings lcfirst
(PHP 5 >= 5.3.0, PHP 7, PHP 8)
lcfirst — 문자열의 첫 문자를 소문자로 만들기
설명
lcfirst(string $string
): string
해당 문자가 알파벳인 경우 string
의 첫 번째 문자가 소문자인 문자열을 반환합니다.
'alphabetic'은 현재 로케일에 따라 결정됩니다. 예를 들어, 기본 "C" 로케일에서 umlaut-a (ä)와 같은 문자는 변환되지 않습니다.
매개변수
string
- 입력 문자열입니다.
반환 값
결과 문자열을 반환합니다.
Examples
예제 #1 lcfirst() 예제
<?php
$foo = 'HelloWorld';
$foo = lcfirst($foo); // helloWorld
$bar = 'HELLO WORLD!';
$bar = lcfirst($bar); // hELLO WORLD!
$bar = lcfirst(strtoupper($bar)); // hELLO WORLD!
?>
기타
- ucfirst() - 문자열의 첫 번째 문자를 대문자로 만들기
- strtolower() - 문자열을 소문자로 만들기
- strtoupper() - 문자열을 대문자로 만들기
- ucwords() - 문자열에서 각 단어의 첫 번째 문자를 대문자로