PHP ucfirst Function

What is ucfirst Function?

Explanation

In PHP, this function converts the first character of a string to uppercase.

Syntax:


ucfirst(string)

In the above syntax, given "string" is the input whose first character need to be converted to uppercase.

Example :


<?php
echo ucfirst("web world");
?>
Result :

Web world

In the above example the first character "w" of the string "web world" is changed to upper case.

PHP Topics


Ask Questions

Ask Question