phasync
Console / pad

Method

Console::pad

Returns $markup padded with $pad to $width columns.

Description#

public static Console::pad(
    string $markup,
    int $width,
    int $align = STR_PAD_RIGHT,
    string $pad = ' '
): string

$align is STR_PAD_RIGHT (the default, left-aligned), STR_PAD_LEFT (right-aligned) or STR_PAD_BOTH (centered). Wider markup is returned as it is.

Parameters#

$markup string
$width int
$align int = STR_PAD_RIGHT
$pad string = ' '

Return values#

string