Here is the full code
* @param string $string String to convert.
*/
public static function mb_ucwords( $string ) {
if ( ! function_exists( ‘mb_convert_case’ ) || ! function_exists( ‘mb_detect_encoding’ ) || mb_detect_encoding( $string ) !== ‘UTF-8’ ) {
return ucwords( $string );
}
$words = preg_split( ‘/([\s]+)/u’, $string, -1, PREG_SPLIT_DELIM_CAPTURE );
$ucwords = ”;
foreach ( $words as $word ) {
$ucwords .= preg_match( ‘/[\p{L}]/u’, $word[0] ) ? mb_strtoupper( $word[0], ‘UTF-8’ ) . mb_substr( $word, 1, mb_strlen( $word ), ‘UTF-8’ ) : $word;
}
return $ucwords;
}
}
and here is the 235 lin
$ucwords .= preg_match( ‘/[\p{L}]/u’, $word[0] ) ? mb_strtoupper( $word[0], ‘UTF-8’ ) . mb_substr( $word, 1, mb_strlen( $word ), ‘UTF-8’ ) : $word;
Hello,
It seems that you already created a support ticket for a similar issue and we’ve already replied there.
I am now closing this ticket to avoid duplicate replies.
We are looking forward to helping you there.
Thank you.