lcfirst() changes the first ASCII letter to lowercase and leaves the remaining string unchanged. For non-ASCII case conversion, use the appropriate multibyte-aware approach.
$value = 'HelloWorld';
echo lcfirst($value); // helloWorldStart with this current pattern. The examples below are retained, corrected where necessary, and expanded for additional variations and output.
$str="Welcome to Plus2net.com";
echo lcfirst($str);
Output is here
welcome to plus2net.com
Syntax
lcfirst( $input_string)
| Parameter | DESCRIPTION |
|---|---|
| $input_string | Required : Input string |
$str = "Hello World";
echo lcfirst($str); // Output: "hello World"
$str = "HELLO WORLD";
echo lcfirst($str); // Output: "hELLO WORLD"
$str = "john doe";
echo ucfirst(lcfirst($str)); // Output: "John doe" (First letter of string capitalized, rest unchanged)
<?php
$str = "@Hello World!";
echo lcfirst($str); // Output: "@Hello World!"
?>
Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.