ucfirst
(PHP 4, PHP 5)
ucfirst — Converte para maiúscula o primeiro caractere de uma string
Descrição
string ucfirst
( string $str
)
Retorna uma string com o primeiro caractere de str em maiúscula, se o caractere for do alfabeto.
Note que o alfabeto é determinado pelo locale atual. Por exemplo, no locale padrão "C" caracteres como ä não serão convertidos.
Example#1 Exemplo ucfirst()
<?php
$foo = 'hello world!';
$foo = ucfirst($foo); // Hello world!
$bar = 'HELLO WORLD!';
$bar = ucfirst($bar); // HELLO WORLD!
$bar = ucfirst(strtolower($bar)); // Hello world!
?>
Veja também strtolower(), strtoupper(), e ucwords().