You are here : phpstringucfirst

ucfirst() - string

Returns a string with the first character of
   str capitalized, if that character is
   alphabetic.
Parameters :
  • str - The input string.

  • Syntax

    string ucfirst
        ( string $str
       )


    Example

    <?php$foo = 'hello world!';$foo = ucfirst($foo);             // Hello world!$bar = 'HELLO WORLD!';$bar = ucfirst($bar);             // HELLO WORLD!$bar = ucfirst(strtolower($bar)); // Hello world!?>


    Output / Return Value


    Limitations


    Alternatives / See Also


    Reference