← All docs

mb_str_pad()

Pads a string to a character length using the requested side and encoding.

mb_str_pad()

function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = 1, ?string $encoding = null): string

Pads a string to a character length using the requested side and encoding.

Parameters:

  • $string (string)
  • $length (int)
  • $pad_string (string), default ' ', optional
  • $pad_type (int), default 1, optional
  • $encoding (?string), default null, optional

Returns: string

Availability

No examples yet. Check examples/ and showcases/ for usage patterns.

Internals

For how mb_str_pad is implemented in the compiler, see the internals page.