array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'pt_BR', ), 'this' => array ( 0 => 'function.lcfirst.php', 1 => 'lcfirst', ), 'up' => array ( 0 => 'ref.strings.php', 1 => 'Funções de String', ), 'prev' => array ( 0 => 'function.join.php', 1 => 'join', ), 'next' => array ( 0 => 'function.levenshtein.php', 1 => 'levenshtein', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'pt_BR', 'path' => 'reference/strings/functions/lcfirst.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 5 >= 5.3.0, PHP 7, PHP 8)
lcfirst — Torna minúsculo o primeiro caractere de uma string
Retorna uma string com o primeiro caractere de
string
em letra minúscula se o caractere
for um ASCII na faixa de "A"
(0x41) a
"Z"
(0x5a).
string
A string de entrada.
Retorna a string resultante.
Versão | Descrição |
---|---|
8.2.0 | A conversão de maiúsculas e minúsculas não depende mais da localidade definida com setlocale(). Somente caracteres ASCII serão convertidos. |
Exemplo #1 Exemplo de lcfirst()
<?php
$foo = 'OlaMundo';
$foo = lcfirst($foo); // olaMundo
$bar = 'OLA MUNDO!';
$bar = lcfirst($bar); // oLA MUNDO!
$bar = lcfirst(strtoupper($bar)); // oLA MUNDO!
?>