mb_ucfirst()
mb_ucfirst() — Make a string's first character uppercase.
Built-in function of PHP 8.5. The manual lists it as available in PHP 8 >= 8.4.0. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.
What it does
Performs a multi-byte safe ucfirst() operation, and returns a string with the first character of string title-cased.
Signature
mb_ucfirst(string $string, ?string $encoding = null): string
Parameters
| Parameter | Type | What it takes |
|---|---|---|
| $string | string | The input string. |
| $encoding | ?string | The string encoding. |
Return value
Returns the resulting string.
Example
The PHP manual ships no example for mb_ucfirst(); the signature and the parameter table above are the contract.
See also
mb_lcfirst(), mb_convert_case(), ucfirst()
All PHP 8.5 built-in functions
Reference card built from the PHP manual page mb_ucfirst() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.