bp_core_ucfirst

Multibyte-safe ucfirst() support.

Description

(string) bp_core_ucfirst( (string) $str ); 

Uses multibyte functions when available on the PHP build.

Returns (string)

Parameters (1)

0. $str (string)
String to be upper-cased.

Usage

  1. if ( !function_exists( 'bp_core_ucfirst' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-members/bp-members-functions.php'; 
  3.  
  4. // String to be upper-cased. 
  5. $str = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_core_ucfirst($str); 
  9.  

Defined (1)

The function is defined in the following location(s).

/bp-members/bp-members-functions.php  
  1. function bp_core_ucfirst( $str ) { 
  2. if ( function_exists( 'mb_strtoupper' ) && function_exists( 'mb_substr' ) ) { 
  3. $fc = mb_strtoupper( mb_substr( $str, 0, 1 ) ); 
  4. return $fc.mb_substr( $str, 1 ); 
  5. } else { 
  6. return ucfirst( $str );