php tutorial - PHP ucfirst and lcfirst - php programming - learn php - php code - php script
- The ucfirst string function is used for defining the first character of a string value in upper case.
- The lcfirst string function is used for defining the first character of a string value in lower case.
Sample Code in php : sample php program
<!DOCTYPE html>
<html>
<body>
<?php
echo ucfirst("wikitechy");
echo "<br>";
echo lcfirst("WIKITECHY");
?>
</body>
</html>
click below button to copy the code. php tutorial - team
php programmer Code Explanation :

- echo statement we call the “ucfirst” string function which is used for converting the first letter of the “wikitechy” in uppercase.
- echo statement we call the “lcfirst” string function which is used for converting the first letter of the “WIKITECHY” in lowercase.
php development Sample Output :

- output -> first letter of the term “wikitechy” has been changed to upper case.
- Similarly, over here the first letter of the term “WIKITECHY” has been changed to lower case.