Skip to content

There just should be a leftpad function for PHP 😄

License

Notifications You must be signed in to change notification settings

open-source-contributions/leftpad

 
 

Repository files navigation

Left Pad for PHP

Latest Version on Packagist

A whole package is just one file with a single function leftpad(string $string, int $length, string $filler)

$string - your initial string
$length - final length of returned string
$filler - symbol with which initial string should be left padded

1. Install

composer require alexsoft/leftpad

2. Use it

\Alexsoft\Leftpad\leftpad('foo', 5) // => "  foo"

\Alexsoft\Leftpad\leftpad('1', 3, '0') // => "001"

About

There just should be a leftpad function for PHP 😄

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%