September 2001
Intermediate to advanced
768 pages
32h 45m
English
string ucfirst(string string) Makes the first character in a string uppercase.
Returns:
String; FALSE on error
Description:
ucfirst() attempts to convert the first character in a string to uppercase.
Note:
The function works on the first character in a string—not the first letter character in a string. This means that a string like ' foiled by a leading space' will be unchanged due to the leading space.
Caution:
This function is likely to give unexpected results with non-ASCII character sets. In cases like this, it’s best to code your own replacement function. See ucwords() for a simple example that can easily be modified to fit this need.
Version:
PHP 3+, PHP 4+
See also:
To convert the first character of each word in a string to ...
Read now
Unlock full access