ucfirst(): Converting the first char to upper case

$output=ucfirst($input_str);
ParameterDESCRIPTION
$input_strRequired : Input string
We can use php string function ucfirst() to change all first character of string to upper case

Now let us try with one example

Here is a string variable $str with one string inside it. We will use ucfirst() to capitalize first chars of the string.
$str="welcome to plus2net.com";
$str=ucfirst($str);
echo $str;
The output is here
Welcome To plus2net.com

DEMO

Output :

String Functions ucwords(): To Change first char of all words to upper case of a string. how to change all the letters to upper case
Subscribe to our YouTube Channel here


Subscribe

* indicates required
Subscribe to plus2net

    plus2net.com







    Post your comments , suggestion , error , requirements etc here





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