PHP ucfirst() Function

PHP ucfirst() Function

The ucfirst() function in PHP converts the first character of the specified string to uppercase.

Syntax

Parameter

str(required)- This parameter represents the input string.

Return

This function returns a string with the first character of the specified string capitalized if that character is alphabetic.

Example 1

Output

Example 2

Output

Example 3

Output