Supported Versions: PHP 8 >= PHP 8.3.0
Pad a multibyte string to a certain length with another multibyte string
<?php mb_str_pad(    string $string,    int $length,    string $pad_string = " ",    int $pad_type = STR_PAD_RIGHT,    ?string $encoding = null): string
<?php     public static function padBoth($value, $length, $pad = ' ')

    {

        if (function_exists('mb_str_pad')) {

            return mb_str_pad($value, $length, $pad, STR_PAD_BOTH);

        }



        $short = max(0, $length - mb_strlen($value));
<?php     public static function padLeft($value, $length, $pad = ' ')

    {

        if (function_exists('mb_str_pad')) {

            return mb_str_pad($value, $length, $pad, STR_PAD_LEFT);

        }



        $short = max(0, $length - mb_strlen($value));
<?php     public static function padRight($value, $length, $pad = ' ')

    {

        if (function_exists('mb_str_pad')) {

            return mb_str_pad($value, $length, $pad, STR_PAD_RIGHT);

        }



        $short = max(0, $length - mb_strlen($value));