PHP String Functions

ucfirst() Function

Definition and Usage

The ucfirst() function converts the first character of a string to uppercase.


Syntax

ucfirst(string)


Parameter Description
string Required. Specifies the string to reverse

Example

Convert the first character of "hello" to uppercase:

<?php
echo ucfirst("hello world!");
?>

Run Example>>