ucfirst

Make a string's first character uppercase

Syntax

ucfirst(string $string): string

Parameters

string

The input string.

Return

Returns the resulting string.

Examples

1

<?

$string = 'case case';

$return = ucfirst($string);

echo $return;

?>
Case case

2

<?

$string = 'Case Case';

$return = ucfirst($string);

echo $return;

?>
Case Case

3

<?

$string = 'CASE CASE';

$return = ucfirst($string);

echo $return;

?>
CASE CASE
HomeMenu