PHP Programing language

lcfirst() & ucfirst() Functions in PHP
Previous Home Next
adplus-dvertising

lcfirst()

The lcfirst() function converts the first character of a string to lowercase.

Syntax:
lcfirst(string)

Example:

<?php
echo lcfirst("GUD MORNING!");
?>

Output:

gUD MORNING!

ucfirst()

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

Syntax:
ucfirst(string)

Example:

<?php
echo ucfirst("gud morning!");
?>

Output:

Gud morning!

Previous Home Next