Query: ucwords
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
UCWORDS(3) 1 UCWORDS(3) ucwords - Uppercase the first character of each word in a stringSYNOPSISstring ucwords (string $str)DESCRIPTIONReturns a string with the first character of each word in $str capitalized, if that character is alphabetic. The definition of a word is any string of characters that is immediately after a whitespace (These are: space, form-feed, newline, car- riage return, horizontal tab, and vertical tab).PARAMETERSo $str - The input string.RETURN VALUESReturns the modified string.EXAMPLESExample #1 ucwords(3) example <?php $foo = 'hello world!'; $foo = ucwords($foo); // Hello World! $bar = 'HELLO WORLD!'; $bar = ucwords($bar); // HELLO WORLD! $bar = ucwords(strtolower($bar)); // Hello World! ?>NOTESNote This function is binary-safe.SEE ALSOstrtoupper(3), strtolower(3), ucfirst(3), mb_convert_case(3). PHP Documentation Group UCWORDS(3)