src/MbString.php
private static function mb_fill_string(string $pattern, $length, $encoding = 'UTF-8'): string
    {
        $pattern_length = mb_strlen($pattern, $encoding);
        $str = '';
        $i = 0;
        while ($i < $length) {
            if ($length - $i >= $pattern_length) {
                $str .= $pattern;
                $i += $pattern_length;
            } else {
                $str .= mb_substr($pattern, 0, $length - $i, $encoding);
                break;
            }
        }
        return $str;
    }
private static function mb_fill_string(string $pattern, $length, $encoding = 'UTF-8'): string
    {
        $pattern_length = mb_strlen($pattern, $encoding);
        $str = '';
        $i = 0;
        while ($i < $length) {
            if ($length - $i >= $pattern_length) {
                $str .= $pattern;
                $i += $pattern_length;
            } else {
                $str .= mb_substr($pattern, 0, $length - $i, $encoding);
                break;
            }
        }
        return $str;
    }
private static function mb_fill_string ( string $ pattern , $ length , $ encoding = 'UTF-8' ) : string { $ pattern_length = mb_strlen ( $ pattern , $ encoding ) ; $ str = '' ; $ i = 0 ; while ( $ i < $ length ) { if ( $ length - $ i >= $ pattern_length ) { $ str .= $ pattern ; $ i += $ pattern_length ; } else { $ str .= mb_substr ( $ pattern , 0 , $ length - $ i , $ encoding ) ; break ; } } return $ str ; }
Returns a string of given length filled with some pattern substring

@param string $pattern
@param $length
@param string $encoding
@return string
Returns a string of given length filled with some pattern substring