Search Results

  1. Make a string's first character uppercase

    • Sprintf

      Sprintf - PHP: ucfirst - Manual

    • Printf

      Printf - PHP: ucfirst - Manual

    • Vsprintf

      Vsprintf - PHP: ucfirst - Manual

    • Vfprintf

      Parameters ¶ stream format The format string is composed of...

    • Bin2hex

      Convert binary data into hexadecimal representation

    • Htmlentities

      This function is identical to htmlspecialchars () in all...

    • Functions

      Functions Functions ¶ Table of Contents ¶ User-defined...

    • Strcmp

      strcmp (PHP 4, PHP 5, PHP 7, PHP 8) strcmp — Binary safe...

  2. The ucfirst () function converts the first character of a string to uppercase. Related functions: lcfirst () - converts the first character of a string to lowercase ucwords () - converts the first character of each word in a string to uppercase strtoupper () - converts a string to uppercase strtolower () - converts a string to lowercase

  3. www.phptutorial.netphp-tutorial › php-ucfirstPHP ucfirst () Function

    • Introduction to The Php ucfirst() Function
    • Php ucfirst() Function Example
    • Dealing with Multibyte Characters
    • Summary

    The ucfirst() function accepts a string and returns a new stringwith the first character converted to uppercase if that character is alphabetic. Here’s the syntax of the ucfirst()function: The ucfirst()function use the current locale to determine which character is alphabetic.

    The following example uses the ucfirst()function to convert the first characters of the first name and last name to uppercase: Output:

    The ucfirst() doesn’t support multibyte strings. To return a new string with the first character converted to uppercase, you can use the following mb_ucfirst()function: How it works. First, get the first character of the $str using the mb_substr() function and convert it to uppercase using the mb_strtoupper()function: Then, concatenate the uppercas...

    Use the ucfirst()function to returns a string with the first alphabetic character converted to uppercase.

  4. Jul 11, 2025 · The ucfirst () function is a built-in function in PHP which takes a string as an argument and returns the string with the first character in Upper Case and all other characters remain unchanged.

  5. PHP ucfirst () Function Topic: PHP String Reference Prev | Next Description The ucfirst() function converts the first character of a string to uppercase. The following table summarizes the technical details of this function.

    • Returns the modified string.
    • PHP 4+
  6. What is the ucfirst () Function? The ucfirst () function is a built-in function in PHP that capitalizes the first character of a string. This function is particularly useful in various scenarios, such as formatting user inputs, displaying titles, and creating aesthetically pleasing outputs.

  7. People also ask

  8. Returns a string with the first character of str capitalized, if that character is alphabetic.