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 @microbiologynote,
Thank you for contacting the support.
We have already replied to the topic you created in our forum. Please check the reply there and add your response so our support team can assist you further:
https://support.rankmath.com/ticket/showing-this-warning-when-i-tried-to-updated-my-php-version-to-8-1/?view=all#post-512708
Looking forward to helping you.