Home » PHP

PHP ucfirst() function with example

PHP ucfirst() function: Here, we are going to learn about the ucfirst() function with example.
Submitted by IncludeHelp, on February 03, 2019

PHP ucfirst() function

ucfirst() function is a string function, it is used to convert first character to uppercase. It accepts string and returns string with first uppercase character.

Syntax:

    ucfirst(string);

Example:

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

PHP code:

<?PHP
    $str = "this is MY computer!";
    
    echo (ucfirst($str));
?>

Output

This is MY computer!





Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.
Learn PCB Designing: PCB DESIGNING TUTORIAL




Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing » Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.