Showing Warning: Uninitialized string offset 0 in

#512777
  • Resolved Sourav Pan
    Rank Math free

    I updated my php to 8.1 then it showing this error msg’
    Warning: Uninitialized string offset 0 in /home/u554146333/domains/microbiologynote.com/public_html/wp-content/plugins/seo-by-rank-math/vendor/mythemeshop/wordpress-helpers/src/helpers/class-str.php on line 235

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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.

Viewing 2 replies - 1 through 2 (of 2 total)

The ticket ‘Showing Warning: Uninitialized string offset 0 in’ is closed to new replies.