/** * Callback function for preg_replace_callback call in utf8_ucwords * * You don't need to call this yourself * * @param array of matches corresponding to a single word * @return string with first char of the word in uppercase * @see ucwords * @see strtoupper */ public static function ucwords_callback($matches) { $leadingws = $matches[2]; $ucfirst = KHelperString::strtoupper($matches[3]); $ucword = KHelperString::substr_replace(ltrim($matches[0]), $ucfirst, 0, 1); return $leadingws . $ucword; }