Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<mb_trimPspell>
^Multibyte String FunctionsLast updated: Mon, 26 Oct 2026

mb_ucfirst

(PHP 8 >= 8.4.0)

mb_ucfirst — Make a string's first character uppercase

Description

function mb_ucfirst(string $string, ?string $encoding = null): string

Performs a multi-byte safe ucfirst() operation, and returns a string with the first character of string title-cased.

Parameters

string

The input string.

encoding

The string encoding.

Return Values

Returns the resulting string.

Notes

Note:

By contrast to the standard case folding functions such as strtolower() and strtoupper(), case folding is performed on the basis of the Unicode character properties. Thus the behaviour of this function is not affected by locale settings and it can convert any characters that have 'alphabetic' property, such a-umlaut (รค).

For more information about the Unicode properties, please see » https://www.unicode.org/reports/tr21/.

See Also


<mb_trimPspell>
^Multibyte String FunctionsLast updated: Mon, 26 Oct 2026