PHPackages                             painless-php/string - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. painless-php/string

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

painless-php/string
===================

String helper functionality for PHP

v2.1.0(11mo ago)024MITPHPPHP &gt;=8.1

Since Feb 18Pushed 11mo agoCompare

[ Source](https://github.com/painless-php/string)[ Packagist](https://packagist.org/packages/painless-php/string)[ RSS](/packages/painless-php-string/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (4)Used By (0)

string
======

[](#string)

String helper functionality for PHP

Installation
------------

[](#installation)

```
composer require painless-php/string

```

Public API
----------

[](#public-api)

#### Core

[](#core)

- [Str](doc/Str.md)
- [StrBuilder](doc/StrBuilder.md)

#### Exception

[](#exception)

- `PainlessPHP\String\Exception\StringSearchException`
- `PainlessPHP\String\Exception\StringTypeConversionException`

Development
-----------

[](#development)

#### Dynamic method doc generation

[](#dynamic-method-doc-generation)

Use `php bin/generate_builder_docblock.php` to generate phpdocumentor docblocks for the methods that can be called dynamically from StrBuilder.

#### TODO

[](#todo)

- generate Str method list in docs with a markdown table
- bump required php version to 8.4 and add `$builder->str` getter for the result string
- methods

    - findFirstLineContaining
    - findLinesContaining
    - findLastLineContaining
    - trimLines
    - editLines

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance50

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81.4% 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 ~51 days

Total

3

Last Release

351d ago

Major Versions

v1.0.0 → v2.0.02025-04-16

### Community

Maintainers

![](https://www.gravatar.com/avatar/3839f3fb0c50b415aacf70b6cd2f41ff254d93af78dfd58e4e41e57aa5a676cb?d=identicon)[PainlessPHP](/maintainers/PainlessPHP)

---

Top Contributors

[![nonetallt](https://avatars.githubusercontent.com/u/22174322?v=4)](https://github.com/nonetallt "nonetallt (70 commits)")[![xHeaven](https://avatars.githubusercontent.com/u/14284867?v=4)](https://github.com/xHeaven "xHeaven (16 commits)")

---

Tags

stringhelpers

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/painless-php-string/health.svg)

```
[![Health](https://phpackages.com/badges/painless-php-string/health.svg)](https://phpackages.com/packages/painless-php-string)
```

###  Alternatives

[danielstjules/stringy

A string manipulation library with multibyte support

2.4k26.0M191](/packages/danielstjules-stringy)[nette/utils

🛠 Nette Utils: lightweight utilities for string &amp; array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.

2.1k394.3M1.5k](/packages/nette-utils)[voku/stringy

A string manipulation library with multibyte support

1783.8M19](/packages/voku-stringy)[pragmarx/ia-str

Laravel Illuminate Agnostic Str

523.5M5](/packages/pragmarx-ia-str)[statamic/stringy

A string manipulation library with multibyte support, forked from @statamic

234.5M14](/packages/statamic-stringy)[opis/string

Multibyte strings as objects

7120.9M7](/packages/opis-string)

PHPackages © 2026

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