Collections functions
Encryption functions
General functions
Theme permission functions
Resource functions

ucfirstletter()

Description

Returns a string with the first LETTER of $string capitalized.
Compare with ucfirst($string) which returns a string with first CHAR of $string capitalized:
ucfirstletter("abc") / ucfirstletter("%abc") returns "Abc" / "%Abc"
ucfirst("abc") / ucfirst("%abc") returns "Abc" / "%abc"

Search for the first letter ([a-zA-Z]), which may or may not be followed by other characters (.).
Replaces the found substring ('$0') with the same substring but now with the first character capitalized, using ucfirst().
Note the /e modifier: If this modifier is set, preg_replace() does normal substitution of backreferences in the replacement
string, evaluates it as PHP code, and uses the result for replacing the search string.

Parameters

ColumnTypeDefaultDescription
$string mixed

Return

void

Location

include/language_functions.php lines 307 to 310

Definition

 
function ucfirstletter($string)
    {
    return 
preg_replace_callback("/[a-zA-Z].*/""ucfirstletter_callback"$string);
    }

This article was last updated 10th July 2020 00:35 Europe/London time based on the source file dated 7th July 2020 14:31 Europe/London time.