PHPackages                             alexsoft/leftpad - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. alexsoft/leftpad

ActiveLibrary

alexsoft/leftpad
================

There just should be a leftpad function for PHP

1.3.0(5mo ago)6722MITPHPPHP ^7.4 || ^8.0CI passing

Since Mar 24Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/alexsoft/leftpad)[ Packagist](https://packagist.org/packages/alexsoft/leftpad)[ RSS](/packages/alexsoft-leftpad/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (3)Dependencies (1)Versions (8)Used By (0)

Left Pad for PHP
================

[](#left-pad-for-php)

[![Latest Version on Packagist](https://camo.githubusercontent.com/c4e4fe05041971c60ef00cb506000190168aa6032ba5f17cc1bdf1f59a318689/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616c6578736f66742f6c6566747061642e7376673f7374796c653d666c6174)](https://packagist.org/packages/alexsoft/leftpad)

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

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

```

### 1. Install

[](#1-install)

```
composer require alexsoft/leftpad
```

### 2. Use it

[](#2-use-it)

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

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

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance70

Regular maintenance activity

Popularity15

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 95.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~588 days

Recently: every ~882 days

Total

7

Last Release

172d ago

PHP version history (4 changes)v1.0.1PHP &gt;=5.6.0

1.1.0PHP ^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0

1.2.0PHP ^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0

1.3.0PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/8b007906f72b36ec7614b7a0a5d4455e5e40c2fdfc3c7e4b9b3d605c379664b7?d=identicon)[alexsoft](/maintainers/alexsoft)

---

Top Contributors

[![alexsoft](https://avatars.githubusercontent.com/u/1451894?v=4)](https://github.com/alexsoft "alexsoft (41 commits)")[![ryanwinchester](https://avatars.githubusercontent.com/u/2897340?v=4)](https://github.com/ryanwinchester "ryanwinchester (1 commits)")[![Seldaek](https://avatars.githubusercontent.com/u/183678?v=4)](https://github.com/Seldaek "Seldaek (1 commits)")

---

Tags

leftpadphpleftpad

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/alexsoft-leftpad/health.svg)

```
[![Health](https://phpackages.com/badges/alexsoft-leftpad/health.svg)](https://phpackages.com/packages/alexsoft-leftpad)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
