You are here : phpstringucwords

ucwords() - string

Returns a string with the first character of each word in
   str capitalized, if that character is alphabetic.
Parameters :
  • str - The input string.
  • delimiters - The optional delimiters contains the word separator characters.

  • Syntax

    string ucwords
        ( string $str
       [, 
    string $delimiters = " 	
    fv"
    
      ] )


    Example

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


    Output / Return Value


    Limitations


    Alternatives / See Also


    Reference