PHPackages                             dmeroff/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. dmeroff/string

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

dmeroff/string
==============

PHP 5.3 String manipulation library

v1.0(12y ago)239MITPHP

Since Jul 15Pushed 12y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (2)Used By (0)

String [![Build Status](https://camo.githubusercontent.com/2a0772595dabc5a3d56cefc2a4316e0940bbc43e4aee68becb5adff1e62fddbb/68747470733a2f2f7472617669732d63692e6f72672f646d65726f66662f737472696e672e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/dmeroff/string)
================================================================================================================================================================================================================================================================================

[](#string-)

String class
------------

[](#string-class)

String is a class that turns string into PHP objects. It implements a fluent interface, improving how we manipulate strings, and extends functionality by providing common functions.

Imagine that you need to replace "hello" to "goodbye" and make first letter uppercase. In classic PHP it would like something like this:

```
$string = 'hello, world';
$string = str_replace('hello', 'goodbye', $string);
$string = ucfirst($string);
echo $string; // Goodbye, world
```

Using the String class it gets simpler:

```
$string = 'hello, world';
$string = new String\String($string);
echo $string->replace('hello', 'goodbye')->sentencecase(); // Goodbye, world
```

OR

```
$string = 'hello, world';
echo String\String::make($string)->replace('hello', 'goodbye')->sentencecase(); // Goodbye, world
```

LetterPairSimilarity class
--------------------------

[](#letterpairsimilarity-class)

This class can be used to compare string using ["Strike a match"](http://www.catalysoft.com/articles/strikeamatch.html) algorithm.

```
$similarity = String\LetterPairSimilarity::compare('Healed', 'Healthy');
echo round($similarity, 2); // 0.55
```

Requirements
------------

[](#requirements)

- PHP 5.3 and higher
- mbstring extension

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

4686d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/afc48e7ff5214f960584341e47b115b91a16f058aeaffe9996731d0f2ee53017?d=identicon)[dmeroff](/maintainers/dmeroff)

---

Top Contributors

[![dmeroff](https://avatars.githubusercontent.com/u/1734389?v=4)](https://github.com/dmeroff "dmeroff (28 commits)")

---

Tags

string

### Embed Badge

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

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

###  Alternatives

[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)[danielstjules/stringy

A string manipulation library with multibyte support

2.4k26.0M191](/packages/danielstjules-stringy)[spatie/string

String handling evolved

5604.6M24](/packages/spatie-string)[coduo/php-to-string

Simple library that converts PHP value into strings

27112.7M10](/packages/coduo-php-to-string)[kwn/number-to-words

Multi language standalone PHP number to words converter. Fully tested, open for extensions and new languages.

4235.0M21](/packages/kwn-number-to-words)[voku/stringy

A string manipulation library with multibyte support

1783.8M19](/packages/voku-stringy)

PHPackages © 2026

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