bp_core_ucfirst( string $str )

Multibyte-safe ucfirst() support.

Description

Uses multibyte functions when available on the PHP build.

Parameters

$str

(Required) String to be upper-cased.

Return

(string)

Source

File: bp-members/bp-members-functions.php

function bp_core_ucfirst( $str ) {
	if ( function_exists( 'mb_strtoupper' ) && function_exists( 'mb_substr' ) ) {
		$fc = mb_strtoupper( mb_substr( $str, 0, 1 ) );
		return $fc.mb_substr( $str, 1 );
	} else {
		return ucfirst( $str );
	}
}

Changelog

Changelog
Version Description
BuddyPress 1.0.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.