bp_core_ucfirst( string $str )

Multibyte-safe ucfirst() support.


Description Description

Uses multibyte functions when available on the PHP build.


Parameters Parameters

$str

(Required) String to be upper-cased.


Top ↑

Return Return

(string)


Top ↑

Source 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 );
	}
}

Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.