All Functions

rightpad - Right Padding

This method adds padding characters to the end of a string until it reaches a certain lenght.

You can define the length of the string and the padding to be used.


rightpad ( $subject , $length , $padding ) Returns the string $subject with length length padded with $padding characters


$subject The string (or number) to be lengthened
$length the length of the target string after adding padding

The string to be added to the subject as padding

Note: If the padding string is longer than one character, the length of the target string can become larger than $length


Right Padding Example

Returns: 123***

rightpad(leftpadding is 1337,100,!)
Returns: rightpadding is 1337!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

See also

truncate - truncate string length replace - string replace leftpad - Left Padding