Oihana PHP

ucFirst.php

Table of Contents

Functions

ucFirst()  : string
Uppercases the first character of a string (multibyte-safe).

Functions

ucFirst()

Uppercases the first character of a string (multibyte-safe).

ucFirst(string $source) : string

Unlike the native ucfirst(), accented and multibyte first letters are handled correctly. The rest of the string is left untouched.

Parameters
$source : string

The input string.

Tags
example
use function oihana\core\strings\ucFirst;

echo ucFirst( 'hello' ) ; // "Hello"
echo ucFirst( 'élan' )  ; // "Élan"
author

Marc Alcaraz (ekameleon)

since
1.0.9
Return values
string

The string with its first character upper-cased.

On this page

Search results