Example 1 — Lowercase the First Letter
Pass a string and get it back with a lowercase first letter.
<?php
$text = "Hello World";
$result = lcfirst($text);
echo $result, PHP_EOL; How It Works
- Start with a string. It begins with an uppercase H.
- Call lcfirst. The first character becomes lowercase.
- Rest stays the same. The W in World is still uppercase.
- Print the result. The output is hello World.

