3.6. Function reference
3.6.22. pad()
3.6.21. number()
« Previous
3.6.23. pluralize()
Next »

3.6.22. pad()

Referencemixed pad(mixed $value, int $length [, string $padString, [, string $paddingType]])
Versionssince 2.0.5

Pads a string $value to a certain length with another string. If the input string length is greater than or equal to $length, no padding takes place. Otherwise, the string is padded with $padSymbol symbols which are spaces by default. $paddingType specifies the padding type:

right - pads on the right (default)

left - pads on the left.

both - pads on the both sides.

$padString can be truncated if the number of padded characters is not evenly divided by the $padSymbol length.

This function can operate also on a container of strings, padding all of them and returning the modified container.

3.6.22. pad()
3.6. Function reference
« Previous
3.6.21. number()
Next »
3.6.23. pluralize()