padEnd.php
Table of Contents
Functions
- padEnd() : string
- Pads a UTF-8 string on the right (end) to a certain length using a specified padding string.
Functions
padEnd()
Pads a UTF-8 string on the right (end) to a certain length using a specified padding string.
padEnd(string|null $source, int $size, string $pad) : string
If the source string is null, it is treated as an empty string. The padding uses grapheme clusters to correctly handle multibyte characters.
Parameters
- $source : string|null
-
The input string or null.
- $size : int
-
Desired length after padding (in grapheme clusters).
- $pad : string
-
The string to use for padding (cannot be empty).
Tags
Return values
string —The right-padded string.