ucwords

string ucwords(string string) 

Converts the first character of every word in a string to uppercase.

Returns:

String; FALSE on error

Description:

ucwords() converts the first character of every word in a string to uppercase.

The function operates in a fairly simple manner. It loops through each character in a string. When it encounters a whitespace character, it attempts to convert the next character to uppercase. (In most cases, this function considers spaces, horizontal tabs, linefeeds, vertical tabs, formfeeds, and carriage returns to be whitespace—this may depend on the C compiler used.) It also attempts to convert the first character in the string to uppercase.

Note:

This behavior means that ucwords() doesn’t always perform as expected. ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.