lcfirst(): first char to lower case

$str="Welcome to Plus2net.com";
echo  lcfirst($str);
Output is here
welcome to plus2net.com
Syntax
lcfirst( $input_string)
ParameterDESCRIPTION
$input_stringRequired : Input string
Output is the string with first char in lower case.

Let us try some examples

DEMO

Output :

Example: Convert Only First Character to Lowercase

$str = "Hello World";
echo lcfirst($str);  // Output: "hello World"

Example: Using lcfirst() with All Uppercase Strings

$str = "HELLO WORLD";
echo lcfirst($str);  // Output: "hELLO WORLD"

Example: Combining lcfirst() with ucfirst()

$str = "john doe";
echo ucfirst(lcfirst($str));  // Output: "John doe" (First letter of string capitalized, rest unchanged)

Example 2: Using lcfirst() with Special Characters

<?php
$str = "@Hello World!";
echo lcfirst($str);  // Output: "@Hello World!"
?>



String Functions ucfirst(): First char to upper case strtolower(): To all lower case strtoupper(): To all upper case Counting Sub string inside a string
Subhendu Mohapatra — author at plus2net
Subhendu Mohapatra

Author

🎥 Join me live on YouTube

Passionate about coding and teaching, I publish practical tutorials on PHP, Python, JavaScript, SQL, and web development. My goal is to make learning simple, engaging, and project‑oriented with real examples and source code.



Subscribe to our YouTube Channel here



plus2net.com











PHP video Tutorials
We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
©2000-2025   plus2net.com   All rights reserved worldwide Privacy Policy Disclaimer