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 :

Code Explanation for ucfirst lcfirst In PHP

  1. echo statement we call the “ucfirst” string function which is used for converting the first letter of the “wikitechy” in uppercase.
  2. 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 for ucfirst lcfirst In PHP

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


Related Searches to php ucfirst lcfirst

Adblocker detected! Please consider reading this notice.

We've detected that you are using AdBlock Plus or some other adblocking software which is preventing the page from fully loading.

We don't have any banner, Flash, animation, obnoxious sound, or popup ad. We do not implement these annoying types of ads!

We need money to operate the site, and almost all of it comes from our online advertising.

Please add wikitechy.com to your ad blocking whitelist or disable your adblocking software.

×