PHP ucfirst() function with example

PHP ucfirst() work: Here, we will find out about the ucfirst() work with an example.

PHP ucfirst() work

ucfirst() work is a string capacity, it is utilized to change over the first character to capitalized. It acknowledges string and returns a string with first capitalized character.




    Input: "this is MY computer!"
    Output: "This is MY computer!"

PHP Code:

    $str = "this is MY computer!";
    echo (ucfirst($str));


This is MY computer!

Leave a Comment

error: Alert: Content is protected!!